MachineIntelligenceCore:Algorithms
|
Importer responsible for importing/loading raw text files and returning characters one by one, the character denotes the label on its own. More...
#include <RawTextImporter.hpp>
Public Member Functions | |
RawTextImporter (std::string node_name_="raw_text_importer") | |
virtual | ~RawTextImporter () |
bool | importData () |
void | setDataFilename (std::string data_filename_) |
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< char, char > &batch_) | |
mic::types::Batch< char, char > & | operator= (const mic::types::Batch< char, char > &batch_) |
virtual | ~Batch () |
std::vector< std::shared_ptr < char > > & | data () |
Returns sample data. More... | |
std::shared_ptr< char > | data (size_t index_) |
std::vector< std::shared_ptr < char > > & | labels () |
Returns sample labels. More... | |
std::shared_ptr< char > | 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< char, char > | getRandomBatch () |
mic::types::Batch< char, char > | getNextBatch () |
mic::types::Batch< char, char > | getBatch (std::vector< size_t > indices_) |
mic::types::Batch< char, char > | getBatchDirect (std::vector< size_t > indices_) |
bool | isLastBatch () |
mic::types::Sample< char, char > | getRandomSample () |
mic::types::Sample< char, char > | getNextSample () |
mic::types::Sample< char, char > | getSample (size_t index_) |
mic::types::Sample< char, char > | getSampleDirect (size_t index_) |
void | setNextSampleIndex (size_t index_=0) |
bool | isLastSample () |
virtual void | add (mic::types::Sample< char, char > sample_) |
virtual void | add (std::shared_ptr< char > data_, std::shared_ptr< char > label_, size_t index_) |
virtual void | add (std::shared_ptr< char > data_, std::shared_ptr< char > 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 < char > > | sample_data |
Stores the data. More... | |
std::vector< std::shared_ptr < char > > | 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 |
Importer responsible for importing/loading raw text files and returning characters one by one, the character denotes the label on its own.
Definition at line 35 of file RawTextImporter.hpp.
mic::importers::RawTextImporter::RawTextImporter | ( | std::string | node_name_ = "raw_text_importer" | ) |
Constructor. Sets MNIST image default properties. Registers properties.
node_name_ | Name of the node in configuration file. |
Definition at line 30 of file RawTextImporter.cpp.
References data_filename.
|
inlinevirtual |
Virtual destructor. Empty.
Definition at line 46 of file RawTextImporter.hpp.
|
virtual |
Method responsible for importing/loading the raw text files.
Implements mic::importers::Importer< char, char >.
Definition at line 42 of file RawTextImporter.cpp.
References mic::types::Batch< char, char >::countClasses(), data_filename, mic::types::Batch< char, char >::sample_data, mic::types::Batch< char, char >::sample_indices, and mic::types::Batch< char, char >::sample_labels.
Referenced by main().
|
inlinevirtual |
Method responsible for initialization of all variables that are property-dependent - here not required, yet empty.
Definition at line 63 of file RawTextImporter.hpp.
void mic::importers::RawTextImporter::setDataFilename | ( | std::string | data_filename_ | ) |
Sets data filename (with path). DEPRICATED (should be used only for testing purposes).
data_filename_ | Path and filename |
Definition at line 37 of file RawTextImporter.cpp.
References data_filename.
Referenced by main().
|
private |
Property: directory/Name of file containing data - raw text.
Definition at line 63 of file RawTextImporter.hpp.
Referenced by importData(), RawTextImporter(), and setDataFilename().