mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
load.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_CORE_DATA_LOAD_HPP
15 #define MLPACK_CORE_DATA_LOAD_HPP
16 
17 #include <mlpack/prereqs.hpp>
18 #include <mlpack/core/util/log.hpp>
19 #include <string>
20 
21 #include "format.hpp"
22 #include "dataset_mapper.hpp"
23 #include "load_csv.hpp"
24 
25 namespace mlpack {
26 namespace data {
27 
62 template<typename eT>
63 bool Load(const std::string& filename,
64  arma::Mat<eT>& matrix,
65  const bool fatal = false,
66  const bool transpose = true);
67 
68 extern template bool Load<int>(const std::string&, arma::Mat<int>&, const bool, const bool);
69 extern template bool Load<size_t>(const std::string&, arma::Mat<size_t>&, const bool, const bool);
70 extern template bool Load<float>(const std::string&, arma::Mat<float>&, const bool, const bool);
71 extern template bool Load<double>(const std::string&, arma::Mat<double>&, const bool, const bool);
72 
73 #ifndef _WIN32
74 extern template bool Load<unsigned long long>(const std::string&, arma::Mat<unsigned long long>&, const bool, const bool);
75 #endif
76 
104 template<typename eT>
105 bool Load(const std::string& filename,
106  arma::Col<eT>& colvec,
107  const bool fatal = false);
108 
136 template<typename eT>
137 bool Load(const std::string& filename,
138  arma::Row<eT>& colvec,
139  const bool fatal = false);
140 
173 template<typename eT, typename PolicyType>
174 bool Load(const std::string& filename,
175  arma::Mat<eT>& matrix,
176  DatasetMapper<PolicyType>& info,
177  const bool fatal = false,
178  const bool transpose = true);
179 
180 extern template bool Load<int, IncrementPolicy>(const std::string&, arma::Mat<int>&,
181  DatasetMapper<IncrementPolicy>&,
182  const bool, const bool);
183 
184 extern template bool Load<size_t, IncrementPolicy>(const std::string&, arma::Mat<size_t>&,
185  DatasetMapper<IncrementPolicy>&,
186  const bool, const bool);
187 
188 extern template bool Load<float, IncrementPolicy>(const std::string&, arma::Mat<float>&,
189  DatasetMapper<IncrementPolicy>&,
190  const bool, const bool);
191 
192 extern template bool Load<double, IncrementPolicy>(const std::string&, arma::Mat<double>&,
193  DatasetMapper<IncrementPolicy>&,
194  const bool, const bool);
195 
196 extern template bool Load<unsigned long long, IncrementPolicy>(const std::string&, arma::Mat<unsigned long long>&,
197  DatasetMapper<IncrementPolicy>&,
198  const bool, const bool);
199 
225 template<typename T>
226 bool Load(const std::string& filename,
227  const std::string& name,
228  T& t,
229  const bool fatal = false,
231 
232 } // namespace data
233 } // namespace mlpack
234 
235 // Include implementation of model-loading Load() overload.
236 #include "load_model_impl.hpp"
237 
238 #endif
template bool Load< size_t >(const std::string &, arma::Mat< size_t > &, const bool, const bool)
format
Define the formats we can read through boost::serialization.
Definition: format.hpp:20
The core includes that mlpack expects; standard C++ includes and Armadillo.
template bool Load< double >(const std::string &, arma::Mat< double > &, const bool, const bool)
template bool Load< size_t, IncrementPolicy >(const std::string &, arma::Mat< size_t > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)
template bool Load< double, IncrementPolicy >(const std::string &, arma::Mat< double > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)
template bool Load< int, IncrementPolicy >(const std::string &, arma::Mat< int > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)
template bool Load< unsigned long long, IncrementPolicy >(const std::string &, arma::Mat< unsigned long long > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)
template bool Load< unsigned long long >(const std::string &, arma::Mat< unsigned long long > &, const bool, const bool)
template bool Load< int >(const std::string &, arma::Mat< int > &, const bool, const bool)
bool Load(const std::string &filename, arma::Mat< eT > &matrix, const bool fatal=false, const bool transpose=true)
Loads a matrix from file, guessing the filetype from the extension.
template bool Load< float >(const std::string &, arma::Mat< float > &, const bool, const bool)
template bool Load< float, IncrementPolicy >(const std::string &, arma::Mat< float > &, DatasetMapper< IncrementPolicy > &, const bool, const bool)