MachineIntelligenceCore:Algorithms
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mic::importers::RawTextImporter Class Reference

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>

Inheritance diagram for mic::importers::RawTextImporter:
Collaboration diagram for mic::importers::RawTextImporter:

Public Member Functions

 RawTextImporter (std::string node_name_="raw_text_importer")
 
virtual ~RawTextImporter ()
 
bool importData ()
 
void setDataFilename (std::string data_filename_)
 
virtual void initializePropertyDependentVariables ()
 
- Public Member Functions inherited from mic::importers::Importer< char, char >
 Importer (std::string node_name_, size_t batch_size_=1)
 
virtual ~Importer ()
 
- Public Member Functions inherited from mic::types::Batch< char, char >
 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

- Protected Attributes inherited from mic::types::Batch< char, char >
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
 

Detailed Description

Importer responsible for importing/loading raw text files and returning characters one by one, the character denotes the label on its own.

Author
tkornuta

Definition at line 35 of file RawTextImporter.hpp.

Constructor & Destructor Documentation

mic::importers::RawTextImporter::RawTextImporter ( std::string  node_name_ = "raw_text_importer")

Constructor. Sets MNIST image default properties. Registers properties.

Parameters
node_name_Name of the node in configuration file.

Definition at line 30 of file RawTextImporter.cpp.

References data_filename.

virtual mic::importers::RawTextImporter::~RawTextImporter ( )
inlinevirtual

Virtual destructor. Empty.

Definition at line 46 of file RawTextImporter.hpp.

Member Function Documentation

bool mic::importers::RawTextImporter::importData ( )
virtual

Method responsible for importing/loading the raw text files.

Returns
TRUE if data loaded successfully, FALSE otherwise.

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().

Here is the call graph for this function:

virtual void mic::importers::RawTextImporter::initializePropertyDependentVariables ( )
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).

Parameters
data_filename_Path and filename

Definition at line 37 of file RawTextImporter.cpp.

References data_filename.

Referenced by main().

Member Data Documentation

mic::configuration::Property<std::string> mic::importers::RawTextImporter::data_filename
private

Property: directory/Name of file containing data - raw text.

Definition at line 63 of file RawTextImporter.hpp.

Referenced by importData(), RawTextImporter(), and setDataFilename().


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