MachineIntelligenceCore:Algorithms
|
Class responsible for importing CIFAR images. Returns a batch of Tensors. Assumes that every image can have different dimensions and belongs to a separate class. More...
#include <BMPImporter.hpp>
Public Member Functions | |
BMPImporter (std::string node_name_="bmp_importer", std::string data_filename_="") | |
virtual | ~BMPImporter () |
void | setDataFilename (std::string data_filename_) |
bool | importData () |
mic::types::TensorPtr< float > | loadBMP (std::ifstream &file_) |
virtual void | initializePropertyDependentVariables () |
![]() | |
Importer (std::string node_name_, size_t batch_size_=1) | |
virtual | ~Importer () |
![]() | |
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 | |
mic::configuration::Property < std::string > | data_filename |
Additional Inherited Members | |
![]() | |
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 |
Class responsible for importing CIFAR images. Returns a batch of Tensors. Assumes that every image can have different dimensions and belongs to a separate class.
Definition at line 41 of file BMPImporter.hpp.
|
inline |
Constructor. Sets default properties. Registers properties.
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 (;). |
Definition at line 48 of file BMPImporter.hpp.
References mic::importers::BMPImporter< eT >::data_filename.
|
inlinevirtual |
Virtual destructor. Empty.
Definition at line 62 of file BMPImporter.hpp.
|
inlinevirtual |
Method responsible for importing/loading the CIFAR dataset.
Implements mic::importers::Importer< mic::types::Tensor< eT >, unsigned int >.
Definition at line 76 of file BMPImporter.hpp.
References mic::importers::BMPImporter< eT >::data_filename, mic::importers::BMPImporter< eT >::loadBMP(), mic::types::Batch< mic::types::Tensor< eT >, unsigned int >::number_of_classes, mic::types::Batch< mic::types::Tensor< eT >, unsigned int >::sample_data, mic::types::Batch< mic::types::Tensor< eT >, unsigned int >::sample_indices, and mic::types::Batch< mic::types::Tensor< eT >, unsigned int >::sample_labels.
|
inlinevirtual |
Method responsible for initialization of all variables that are property-dependent - here not required, yet empty.
Definition at line 228 of file BMPImporter.hpp.
|
inline |
Definition at line 130 of file BMPImporter.hpp.
References MAKE_TENSOR_PTR.
Referenced by mic::importers::BMPImporter< eT >::importData().
|
inline |
Set name and patch of the file/files containing CIFAR images.
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 68 of file BMPImporter.hpp.
References mic::importers::BMPImporter< eT >::data_filename.
|
private |
Property: directory/Name of file containing images (or a list of files separated by a semicolon).
Definition at line 243 of file BMPImporter.hpp.
Referenced by mic::importers::BMPImporter< eT >::BMPImporter(), mic::importers::BMPImporter< eT >::importData(), and mic::importers::BMPImporter< eT >::setDataFilename().