14 #ifndef MLPACK_CORE_DATA_LOAD_HPP 15 #define MLPACK_CORE_DATA_LOAD_HPP 70 bool Load(
const std::string& filename,
71 arma::Mat<eT>& matrix,
72 const bool fatal =
false,
73 const bool transpose =
true,
74 const arma::file_type inputLoadType = arma::auto_detect);
105 template<
typename eT>
106 bool Load(
const std::string& filename,
107 arma::SpMat<eT>& matrix,
108 const bool fatal =
false,
109 const bool transpose =
true);
118 extern template bool Load<int>(
const std::string&,
122 const arma::file_type);
125 extern template bool Load<unsigned int>(
const std::string&,
126 arma::Mat<unsigned int>&,
129 const arma::file_type);
131 extern template bool Load<unsigned long>(
const std::string&,
132 arma::Mat<unsigned long>&,
135 const arma::file_type);
137 extern template bool Load<unsigned long long>(
const std::string&,
138 arma::Mat<unsigned long long>&,
141 const arma::file_type);
143 extern template bool Load<float>(
const std::string&,
147 const arma::file_type);
149 extern template bool Load<double>(
const std::string&,
153 const arma::file_type);
155 extern template bool Load<int>(
const std::string&,
159 const arma::file_type);
161 extern template bool Load<unsigned int>(
const std::string&,
162 arma::SpMat<unsigned int>&,
166 extern template bool Load<unsigned long>(
const std::string&,
167 arma::SpMat<unsigned long>&,
171 extern template bool Load<unsigned long long>(
const std::string&,
172 arma::SpMat<unsigned long long>&,
176 extern template bool Load<float>(
const std::string&,
181 extern template bool Load<double>(
const std::string&,
182 arma::SpMat<double>&,
217 template<
typename eT>
218 bool Load(
const std::string& filename,
220 const bool fatal =
false);
249 template<
typename eT>
250 bool Load(
const std::string& filename,
251 arma::Row<eT>& rowvec,
252 const bool fatal =
false);
290 template<
typename eT,
typename PolicyType>
291 bool Load(
const std::string& filename,
292 arma::Mat<eT>& matrix,
293 DatasetMapper<PolicyType>& info,
294 const bool fatal =
false,
295 const bool transpose =
true);
304 extern template bool Load<int, IncrementPolicy>(
307 DatasetMapper<IncrementPolicy>&,
311 extern template bool Load<arma::u32, IncrementPolicy>(
313 arma::Mat<arma::u32>&,
314 DatasetMapper<IncrementPolicy>&,
318 extern template bool Load<arma::u64, IncrementPolicy>(
320 arma::Mat<arma::u64>&,
321 DatasetMapper<IncrementPolicy>&,
325 extern template bool Load<float, IncrementPolicy>(
328 DatasetMapper<IncrementPolicy>&,
332 extern template bool Load<double, IncrementPolicy>(
335 DatasetMapper<IncrementPolicy>&,
369 bool Load(
const std::string& filename,
370 const std::string& name,
372 const bool fatal =
false,
388 template<
typename eT>
389 bool Load(
const std::string& filename,
390 arma::Mat<eT>& matrix,
392 const bool fatal =
false);
403 template<
typename eT>
404 bool Load(
const std::vector<std::string>& files,
405 arma::Mat<eT>& matrix,
407 const bool fatal =
false);
410 bool LoadImage(
const std::string& filename,
411 arma::Mat<unsigned char>& matrix,
413 const bool fatal =
false);
419 #include "load_model_impl.hpp" 421 #include "load_vec_impl.hpp" 423 #include "load_image_impl.hpp" Linear algebra utility functions, generally performed on matrices or vectors.
format
Define the formats we can read through cereal.
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool LoadImage(const std::string &filename, arma::Mat< unsigned char > &matrix, ImageInfo &info, const bool fatal=false)
bool Load(const std::string &filename, arma::Mat< eT > &matrix, const bool fatal=false, const bool transpose=true, const arma::file_type inputLoadType=arma::auto_detect)
Loads a matrix from file, guessing the filetype from the extension.