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
20 
21 #include "format.hpp"
22 #include "dataset_mapper.hpp"
23 #include "image_info.hpp"
24 
25 namespace mlpack {
26 namespace data {
27 
65 template<typename eT>
66 bool Load(const std::string& filename,
67  arma::Mat& matrix,
68  const bool fatal = false,
69  const bool transpose = true,
70  const arma::file_type inputLoadType = arma::auto_detect);
71 
101 template<typename eT>
102 bool Load(const std::string& filename,
103  arma::SpMat& matrix,
104  const bool fatal = false,
105  const bool transpose = true);
106 
114 extern template bool Load(const std::string&,
115  arma::Mat&,
116  const bool,
117  const bool,
118  const arma::file_type);
119 
120 // size_t and uword should be one of these three typedefs.
121 extern template bool Load(const std::string&,
122  arma::Mat&,
123  const bool,
124  const bool,
125  const arma::file_type);
126 
127 extern template bool Load(const std::string&,
128  arma::Mat&,
129  const bool,
130  const bool,
131  const arma::file_type);
132 
133 extern template bool Load(const std::string&,
134  arma::Mat&,
135  const bool,
136  const bool,
137  const arma::file_type);
138 
139 extern template bool Load(const std::string&,
140  arma::Mat&,
141  const bool,
142  const bool,
143  const arma::file_type);
144 
145 extern template bool Load(const std::string&,
146  arma::Mat&,
147  const bool,
148  const bool,
149  const arma::file_type);
150 
151 extern template bool Load(const std::string&,
152  arma::Mat&,
153  const bool,
154  const bool,
155  const arma::file_type);
156 
157 extern template bool Load(const std::string&,
158  arma::SpMat&,
159  const bool,
160  const bool);
161 
162 extern template bool Load(const std::string&,
163  arma::SpMat&,
164  const bool,
165  const bool);
166 
167 extern template bool Load(const std::string&,
168  arma::SpMat&,
169  const bool,
170  const bool);
171 
172 extern template bool Load(const std::string&,
173  arma::SpMat&,
174  const bool,
175  const bool);
176 
177 extern template bool Load(const std::string&,
178  arma::SpMat&,
179  const bool,
180  const bool);
181 
213 template<typename eT>
214 bool Load(const std::string& filename,
215  arma::Col& vec,
216  const bool fatal = false);
217 
245 template<typename eT>
246 bool Load(const std::string& filename,
247  arma::Row& rowvec,
248  const bool fatal = false);
249 
282 template<typename eT, typename PolicyType>
283 bool Load(const std::string& filename,
284  arma::Mat& matrix,
285  DatasetMapper& info,
286  const bool fatal = false,
287  const bool transpose = true);
288 
296 extern template bool Load(
297  const std::string&,
298  arma::Mat&,
299  DatasetMapper&,
300  const bool,
301  const bool);
302 
303 extern template bool Load(
304  const std::string&,
305  arma::Mat&,
306  DatasetMapper&,
307  const bool,
308  const bool);
309 
310 extern template bool Load(
311  const std::string&,
312  arma::Mat&,
313  DatasetMapper&,
314  const bool,
315  const bool);
316 
317 extern template bool Load(
318  const std::string&,
319  arma::Mat&,
320  DatasetMapper&,
321  const bool,
322  const bool);
323 
324 extern template bool Load(
325  const std::string&,
326  arma::Mat&,
327  DatasetMapper&,
328  const bool,
329  const bool);
330 
360 template<typename T>
361 bool Load(const std::string& filename,
362  const std::string& name,
363  T& t,
364  const bool fatal = false,
366 
380 template<typename eT>
381 bool Load(const std::string& filename,
382  arma::Mat& matrix,
383  ImageInfo& info,
384  const bool fatal = false);
385 
395 template<typename eT>
396 bool Load(const std::vector& files,
397  arma::Mat& matrix,
398  ImageInfo& info,
399  const bool fatal = false);
400 
401 // Implementation found in load_image.cpp.
402 bool LoadImage(const std::string& filename,
403  arma::Mat& matrix,
404  ImageInfo& info,
405  const bool fatal = false);
406 
407 } // namespace data
408 } // namespace mlpack
409 
410 // Include implementation of model-loading Load() overload.
411 #include "load_model_impl.hpp"
412 // Include implementation of Load() for vectors.
413 #include "load_vec_impl.hpp"
414 // Include implementation of Load() for images.
415 #include "load_image_impl.hpp"
416 
417 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
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.
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.