MachineIntelligenceCore:Algorithms
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mic::importers::MNISTMatrixImporter< T > Class Template Reference

#include <MNISTMatrixImporter.hpp>

Inheritance diagram for mic::importers::MNISTMatrixImporter< T >:
Collaboration diagram for mic::importers::MNISTMatrixImporter< T >:

Public Member Functions

 MNISTMatrixImporter (std::string node_name_="mnist_matrix_importer", std::string data_filename_="", std::string labels_filename_="")
 
virtual ~MNISTMatrixImporter ()
 
void setDataFilename (std::string data_filename_)
 
void setLabelsFilename (std::string labels_filename_)
 
bool importData ()
 
virtual void initializePropertyDependentVariables ()
 
- Public Member Functions inherited from mic::importers::Importer< mic::types::Matrix< T >, unsigned int >
 Importer (std::string node_name_, size_t batch_size_=1)
 
virtual ~Importer ()
 
- Public Member Functions inherited from mic::types::Batch< mic::types::Matrix< T >, unsigned int >
 Batch (size_t batch_size_=1)
 
 Batch (const mic::types::Batch< mic::types::Matrix< T >, unsigned int > &batch_)
 
mic::types::Batch
< mic::types::Matrix< T >
, unsigned int > & 
operator= (const mic::types::Batch< mic::types::Matrix< T >, unsigned int > &batch_)
 
virtual ~Batch ()
 
std::vector< std::shared_ptr
< mic::types::Matrix< T > > > & 
data ()
 Returns sample data. More...
 
std::shared_ptr
< mic::types::Matrix< T > > 
data (size_t index_)
 
std::vector< std::shared_ptr
< unsigned int > > & 
labels ()
 Returns sample labels. More...
 
std::shared_ptr< unsigned int > labels (size_t index_)
 
std::vector< size_t > & indices ()
 Returns sample numbers (sample "positions" in original dataset). More...
 
std::vector< size_t > indices (size_t index_)
 
size_t size ()
 
void setBatchSize (size_t batch_size_)
 
size_t getBatchSize ()
 
mic::types::Batch
< mic::types::Matrix< T >
, unsigned int > 
getRandomBatch ()
 
mic::types::Batch
< mic::types::Matrix< T >
, unsigned int > 
getNextBatch ()
 
mic::types::Batch
< mic::types::Matrix< T >
, unsigned int > 
getBatch (std::vector< size_t > indices_)
 
mic::types::Batch
< mic::types::Matrix< T >
, unsigned int > 
getBatchDirect (std::vector< size_t > indices_)
 
bool isLastBatch ()
 
mic::types::Sample
< mic::types::Matrix< T >
, unsigned int > 
getRandomSample ()
 
mic::types::Sample
< mic::types::Matrix< T >
, unsigned int > 
getNextSample ()
 
mic::types::Sample
< mic::types::Matrix< T >
, unsigned int > 
getSample (size_t index_)
 
mic::types::Sample
< mic::types::Matrix< T >
, unsigned int > 
getSampleDirect (size_t index_)
 
void setNextSampleIndex (size_t index_=0)
 
bool isLastSample ()
 
virtual void add (mic::types::Sample< mic::types::Matrix< T >, unsigned int > sample_)
 
virtual void add (std::shared_ptr< mic::types::Matrix< T > > data_, std::shared_ptr< unsigned int > label_, size_t index_)
 
virtual void add (std::shared_ptr< mic::types::Matrix< T > > data_, std::shared_ptr< unsigned int > label_)
 
void countClasses ()
 
size_t classes ()
 

Private Attributes

int image_width
 
int image_height
 
mic::configuration::Property
< std::string > 
data_filename
 
mic::configuration::Property
< std::string > 
labels_filename
 
mic::configuration::Property< int > samples_limit
 

Additional Inherited Members

- Protected Attributes inherited from mic::types::Batch< mic::types::Matrix< T >, unsigned int >
size_t next_sample_index
 
size_t batch_size
 
std::random_device rd
 
std::mt19937_64 rng_mt19937_64
 
std::vector< std::shared_ptr
< mic::types::Matrix< T > > > 
sample_data
 Stores the data. More...
 
std::vector< std::shared_ptr
< unsigned int > > 
sample_labels
 Stores labels. More...
 
std::vector< size_t > sample_indices
 Stores sample indices (sample "positions" in original dataset). More...
 
size_t number_of_classes
 

Detailed Description

template<typename T = float>
class mic::importers::MNISTMatrixImporter< T >

Definition at line 35 of file MNISTMatrixImporter.hpp.

Constructor & Destructor Documentation

template<typename T = float>
mic::importers::MNISTMatrixImporter< T >::MNISTMatrixImporter ( std::string  node_name_ = "mnist_matrix_importer",
std::string  data_filename_ = "",
std::string  labels_filename_ = "" 
)
inline

Constructor. Sets MNIST image default properties. Registers properties.

Parameters
node_name_Name of the node in configuration file.
data_filename_File (with path) containing MNIST images.
labels_filename_File (with path) containing MNIST labels.

Definition at line 43 of file MNISTMatrixImporter.hpp.

References mic::importers::MNISTMatrixImporter< T >::data_filename, mic::importers::MNISTMatrixImporter< T >::image_height, mic::importers::MNISTMatrixImporter< T >::image_width, mic::importers::MNISTMatrixImporter< T >::labels_filename, and mic::importers::MNISTMatrixImporter< T >::samples_limit.

template<typename T = float>
virtual mic::importers::MNISTMatrixImporter< T >::~MNISTMatrixImporter ( )
inlinevirtual

Virtual destructor. Empty.

Definition at line 61 of file MNISTMatrixImporter.hpp.

Member Function Documentation

template<typename T = float>
virtual void mic::importers::MNISTMatrixImporter< T >::initializePropertyDependentVariables ( )
inlinevirtual

Method responsible for initialization of all variables that are property-dependent - here not required, yet empty.

Definition at line 174 of file MNISTMatrixImporter.hpp.

template<typename T = float>
void mic::importers::MNISTMatrixImporter< T >::setDataFilename ( std::string  data_filename_)
inline

Set name and patch of the file containing MNIST images.

Parameters
data_filename_File (with path) containing MNIST images.

Definition at line 67 of file MNISTMatrixImporter.hpp.

References mic::importers::MNISTMatrixImporter< T >::data_filename.

template<typename T = float>
void mic::importers::MNISTMatrixImporter< T >::setLabelsFilename ( std::string  labels_filename_)
inline

Set name and patch of the file containing MNIST labels.

Parameters
labels_filename_File (with path) containing MNIST labels.

Definition at line 75 of file MNISTMatrixImporter.hpp.

References mic::importers::MNISTMatrixImporter< T >::labels_filename.

Member Data Documentation

template<typename T = float>
mic::configuration::Property<std::string> mic::importers::MNISTMatrixImporter< T >::data_filename
private
template<typename T = float>
int mic::importers::MNISTMatrixImporter< T >::image_height
private
template<typename T = float>
int mic::importers::MNISTMatrixImporter< T >::image_width
private
template<typename T = float>
mic::configuration::Property<std::string> mic::importers::MNISTMatrixImporter< T >::labels_filename
private
template<typename T = float>
mic::configuration::Property<int> mic::importers::MNISTMatrixImporter< T >::samples_limit
private

Property: maximum number of samples (limitation, from 1 to 60000). If <=0 then there is no limitation.

Definition at line 200 of file MNISTMatrixImporter.hpp.

Referenced by mic::importers::MNISTMatrixImporter< T >::importData(), and mic::importers::MNISTMatrixImporter< T >::MNISTMatrixImporter().


The documentation for this class was generated from the following file: