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

Class responsible for importing CIFAR images. Returns a batch of Tensors. More...

#include <CIFARImporter.hpp>

Inheritance diagram for mic::importers::CIFARImporter< eT >:
Collaboration diagram for mic::importers::CIFARImporter< eT >:

Public Member Functions

 CIFARImporter (std::string node_name_="cifar_importer", std::string data_filename_="", int min_sample_=-1, int max_sample_=-1)
 
virtual ~CIFARImporter ()
 
void setDataFilename (std::string data_filename_)
 
bool importData ()
 
virtual void initializePropertyDependentVariables ()
 
- Public Member Functions inherited from mic::importers::Importer< mic::types::Tensor< eT >, unsigned int >
 Importer (std::string node_name_, size_t batch_size_=1)
 
virtual ~Importer ()
 
- Public Member Functions inherited from mic::types::Batch< mic::types::Tensor< eT >, unsigned int >
 Batch (size_t batch_size_=1)
 
 Batch (const mic::types::Batch< mic::types::Tensor< eT >, unsigned int > &batch_)
 
mic::types::Batch
< mic::types::Tensor< eT >
, unsigned int > & 
operator= (const mic::types::Batch< mic::types::Tensor< eT >, unsigned int > &batch_)
 
virtual ~Batch ()
 
std::vector< std::shared_ptr
< mic::types::Tensor< eT > > > & 
data ()
 Returns sample data. More...
 
std::shared_ptr
< mic::types::Tensor< eT > > 
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::Tensor< eT >
, unsigned int > 
getRandomBatch ()
 
mic::types::Batch
< mic::types::Tensor< eT >
, unsigned int > 
getNextBatch ()
 
mic::types::Batch
< mic::types::Tensor< eT >
, unsigned int > 
getBatch (std::vector< size_t > indices_)
 
mic::types::Batch
< mic::types::Tensor< eT >
, unsigned int > 
getBatchDirect (std::vector< size_t > indices_)
 
bool isLastBatch ()
 
mic::types::Sample
< mic::types::Tensor< eT >
, unsigned int > 
getRandomSample ()
 
mic::types::Sample
< mic::types::Tensor< eT >
, unsigned int > 
getNextSample ()
 
mic::types::Sample
< mic::types::Tensor< eT >
, unsigned int > 
getSample (size_t index_)
 
mic::types::Sample
< mic::types::Tensor< eT >
, unsigned int > 
getSampleDirect (size_t index_)
 
void setNextSampleIndex (size_t index_=0)
 
bool isLastSample ()
 
virtual void add (mic::types::Sample< mic::types::Tensor< eT >, unsigned int > sample_)
 
virtual void add (std::shared_ptr< mic::types::Tensor< eT > > data_, std::shared_ptr< unsigned int > label_, size_t index_)
 
virtual void add (std::shared_ptr< mic::types::Tensor< eT > > data_, std::shared_ptr< unsigned int > label_)
 
void countClasses ()
 
size_t classes ()
 

Private Attributes

size_t image_height
 
size_t image_width
 
size_t image_depth
 
mic::configuration::Property
< std::string > 
data_filename
 
mic::configuration::Property< int > min_sample
 
mic::configuration::Property< int > max_sample
 

Additional Inherited Members

- Protected Attributes inherited from mic::types::Batch< mic::types::Tensor< eT >, 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::Tensor< eT > > > 
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 eT>
class mic::importers::CIFARImporter< eT >

Class responsible for importing CIFAR images. Returns a batch of Tensors.

Author
tkornuta

Definition at line 41 of file CIFARImporter.hpp.

Constructor & Destructor Documentation

template<typename eT >
mic::importers::CIFARImporter< eT >::CIFARImporter ( std::string  node_name_ = "cifar_importer",
std::string  data_filename_ = "",
int  min_sample_ = -1,
int  max_sample_ = -1 
)
inline

Constructor. Sets CIFAR image default properties. Registers properties.

Parameters
node_name_Name of the node in configuration file.
data_filename_File(s) (with path) containing images. If data is supposed to be loaded from more than one files, they should be separated by a semicolon (;).
min_sample_Index of first sample to be added to batch (samples < min_sample_ will be skipped) (DEFAULT=-1 - all samples).
max_sample_Index of last sample to be added to batch (samples > max_sample_ will be skipped) (DEFAULT=-1 - all samples).

Definition at line 50 of file CIFARImporter.hpp.

References mic::importers::CIFARImporter< eT >::data_filename, mic::importers::CIFARImporter< eT >::image_depth, mic::importers::CIFARImporter< eT >::image_height, mic::importers::CIFARImporter< eT >::image_width, mic::importers::CIFARImporter< eT >::max_sample, and mic::importers::CIFARImporter< eT >::min_sample.

template<typename eT >
virtual mic::importers::CIFARImporter< eT >::~CIFARImporter ( )
inlinevirtual

Virtual destructor. Empty.

Definition at line 72 of file CIFARImporter.hpp.

Member Function Documentation

template<typename eT >
virtual void mic::importers::CIFARImporter< eT >::initializePropertyDependentVariables ( )
inlinevirtual

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

Definition at line 199 of file CIFARImporter.hpp.

template<typename eT >
void mic::importers::CIFARImporter< eT >::setDataFilename ( std::string  data_filename_)
inline

Set name and patch of the file/files containing CIFAR images.

Parameters
data_filename_File (with path) containing CIFAR images. If data is supposed to be loaded from more than one files, they should be separated by a semicolon (;).

Definition at line 78 of file CIFARImporter.hpp.

References mic::importers::CIFARImporter< eT >::data_filename.

Member Data Documentation

template<typename eT >
mic::configuration::Property<std::string> mic::importers::CIFARImporter< eT >::data_filename
private

Property: directory/Name of file containing images (binary files).

Definition at line 230 of file CIFARImporter.hpp.

Referenced by mic::importers::CIFARImporter< eT >::CIFARImporter(), mic::importers::CIFARImporter< eT >::importData(), and mic::importers::CIFARImporter< eT >::setDataFilename().

template<typename eT >
size_t mic::importers::CIFARImporter< eT >::image_depth
private

Depth of CIFAR image (number of channels).

Definition at line 224 of file CIFARImporter.hpp.

Referenced by mic::importers::CIFARImporter< eT >::CIFARImporter(), and mic::importers::CIFARImporter< eT >::importData().

template<typename eT >
size_t mic::importers::CIFARImporter< eT >::image_height
private
template<typename eT >
size_t mic::importers::CIFARImporter< eT >::image_width
private
template<typename eT >
mic::configuration::Property<int> mic::importers::CIFARImporter< eT >::max_sample
private

Property: index of the last sample to be added to batch (samples > max_sample_ will be skipped) (DEFAULT=-1 - all samples).

Definition at line 240 of file CIFARImporter.hpp.

Referenced by mic::importers::CIFARImporter< eT >::CIFARImporter(), and mic::importers::CIFARImporter< eT >::importData().

template<typename eT >
mic::configuration::Property<int> mic::importers::CIFARImporter< eT >::min_sample
private

Property: index of the first sample to be added to batch (samples < min_sample_ will be skipped) (DEFAULT=-1 - all samples).

Definition at line 235 of file CIFARImporter.hpp.

Referenced by mic::importers::CIFARImporter< eT >::CIFARImporter(), and mic::importers::CIFARImporter< eT >::importData().


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