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

Encoder responsible for encoding character into Matrix SDRs. A 1-of-k encoder, i.e. it simply encodes char to ASCII and turns on that bit, i.e. there is no learning. More...

#include <CharMatrixXfEncoder.hpp>

Inheritance diagram for mic::encoders::CharMatrixXfEncoder:
Collaboration diagram for mic::encoders::CharMatrixXfEncoder:

Public Member Functions

 CharMatrixXfEncoder (size_t sdr_length_)
 
 ~CharMatrixXfEncoder ()
 Default destructor - empty. More...
 
virtual mic::types::MatrixXfPtr encodeSample (const std::shared_ptr< char > &sample_)
 Method responsible for encoding of input data sample into SDR (a vector of floats). More...
 
virtual std::shared_ptr< char > decodeSample (const mic::types::MatrixXfPtr &sdr_)
 
- Public Member Functions inherited from mic::encoders::MatrixSDREncoder< char, float >
 MatrixSDREncoder (size_t sdr_length_)
 Constructor. More...
 
virtual ~MatrixSDREncoder ()
 
virtual std::shared_ptr
< mic::types::Matrix< float > > 
encodeBatch (const std::vector< std::shared_ptr< char > > &batch_)
 
virtual std::vector
< std::shared_ptr< char > > 
decodeBatch (const std::shared_ptr< mic::types::Matrix< float > > &sdrs_)
 
size_t getSDRLength ()
 
void setSDRLength (size_t sdr_length_)
 
- Public Member Functions inherited from mic::encoders::Encoder< char, mic::types::Matrix< float > >
 Encoder ()
 Constructor - empty. More...
 
virtual ~Encoder ()
 
virtual std::shared_ptr< char > decodeSample (const std::shared_ptr< mic::types::Matrix< float > > &sdr_)=0
 

Additional Inherited Members

- Protected Attributes inherited from mic::encoders::MatrixSDREncoder< char, float >
size_t sdr_length
 Length of SDR. More...
 

Detailed Description

Encoder responsible for encoding character into Matrix SDRs. A 1-of-k encoder, i.e. it simply encodes char to ASCII and turns on that bit, i.e. there is no learning.

Author
tkornuta

Definition at line 36 of file CharMatrixXfEncoder.hpp.

Constructor & Destructor Documentation

mic::encoders::CharMatrixXfEncoder::CharMatrixXfEncoder ( size_t  sdr_length_)
inline

Default constructor.

Parameters
sdr_length_SDR length.

Definition at line 42 of file CharMatrixXfEncoder.hpp.

mic::encoders::CharMatrixXfEncoder::~CharMatrixXfEncoder ( )
inline

Default destructor - empty.

Definition at line 47 of file CharMatrixXfEncoder.hpp.

Member Function Documentation

std::shared_ptr< char > mic::encoders::CharMatrixXfEncoder::decodeSample ( const mic::types::MatrixXfPtr sdr_)
virtual

Method responsible for decoding of SDR into data.

Parameters
[in]sdr_Shared pointer to SDR.
Returns
Shared pointer to a char

Definition at line 54 of file CharMatrixXfEncoder.cpp.

Referenced by main().

mic::types::MatrixXfPtr mic::encoders::CharMatrixXfEncoder::encodeSample ( const std::shared_ptr< char > &  sample_)
virtual

Method responsible for encoding of input data sample into SDR (a vector of floats).

Parameters
[in]sample_Shared pointer to a char.
Returns
Shared pointer to SDR - here in the form of 1d matrix (cols,1) of floats. Memory to this variable must be assigned earlier.

Implements mic::encoders::Encoder< char, mic::types::Matrix< float > >.

Definition at line 35 of file CharMatrixXfEncoder.cpp.

References mic::encoders::MatrixSDREncoder< char, float >::sdr_length.

Referenced by main().


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