14 #ifndef MLPACK_CORE_DATA_LOAD_HPP 15 #define MLPACK_CORE_DATA_LOAD_HPP 63 bool Load(
const std::string& filename,
64 arma::Mat<eT>& matrix,
65 const bool fatal =
false,
66 const bool transpose =
true);
98 bool Load(
const std::string& filename,
99 arma::SpMat<eT>& matrix,
100 const bool fatal =
false,
101 const bool transpose =
true);
110 extern template bool Load<int>(
const std::string&,
116 extern template bool Load<unsigned int>(
const std::string&,
117 arma::Mat<unsigned int>&,
121 extern template bool Load<unsigned long>(
const std::string&,
122 arma::Mat<unsigned long>&,
126 extern template bool Load<unsigned long long>(
const std::string&,
127 arma::Mat<unsigned long long>&,
131 extern template bool Load<float>(
const std::string&,
136 extern template bool Load<double>(
const std::string&,
141 extern template bool Load<int>(
const std::string&,
146 extern template bool Load<unsigned int>(
const std::string&,
147 arma::SpMat<unsigned int>&,
151 extern template bool Load<unsigned long>(
const std::string&,
152 arma::SpMat<unsigned long>&,
156 extern template bool Load<unsigned long long>(
const std::string&,
157 arma::SpMat<unsigned long long>&,
161 extern template bool Load<float>(
const std::string&,
166 extern template bool Load<double>(
const std::string&,
167 arma::SpMat<double>&,
202 template<
typename eT>
203 bool Load(
const std::string& filename,
205 const bool fatal =
false);
234 template<
typename eT>
235 bool Load(
const std::string& filename,
236 arma::Row<eT>& rowvec,
237 const bool fatal =
false);
271 template<
typename eT,
typename PolicyType>
272 bool Load(
const std::string& filename,
273 arma::Mat<eT>& matrix,
274 DatasetMapper<PolicyType>& info,
275 const bool fatal =
false,
276 const bool transpose =
true);
285 extern template bool Load<int, IncrementPolicy>(
288 DatasetMapper<IncrementPolicy>&,
292 extern template bool Load<arma::u32, IncrementPolicy>(
294 arma::Mat<arma::u32>&,
295 DatasetMapper<IncrementPolicy>&,
299 extern template bool Load<arma::u64, IncrementPolicy>(
301 arma::Mat<arma::u64>&,
302 DatasetMapper<IncrementPolicy>&,
306 extern template bool Load<float, IncrementPolicy>(
309 DatasetMapper<IncrementPolicy>&,
313 extern template bool Load<double, IncrementPolicy>(
316 DatasetMapper<IncrementPolicy>&,
350 bool Load(
const std::string& filename,
351 const std::string& name,
353 const bool fatal =
false,
369 template<
typename eT>
370 bool Load(
const std::string& filename,
371 arma::Mat<eT>& matrix,
373 const bool fatal =
false);
384 template<
typename eT>
385 bool Load(
const std::vector<std::string>& files,
386 arma::Mat<eT>& matrix,
388 const bool fatal =
false);
391 bool LoadImage(
const std::string& filename,
392 arma::Mat<unsigned char>& matrix,
394 const bool fatal =
false);
400 #include "load_model_impl.hpp" 402 #include "load_vec_impl.hpp" 404 #include "load_image_impl.hpp" Linear algebra utility functions, generally performed on matrices or vectors.
format
Define the formats we can read through boost::serialization.
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)
Loads a matrix from file, guessing the filetype from the extension.