MachineIntelligenceCore:Algorithms
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mic::encoders::ColMatrixEncoder< T > Class Template Reference

Encoder responsible for encoding single channel (float) matrices (e.g. grayscale images) into SDRs. There is no learning (auto-encoding), instead it simply transforms matrix of floats into a vector. More...

#include <ColMatrixEncoder.hpp>

Inheritance diagram for mic::encoders::ColMatrixEncoder< T >:
Collaboration diagram for mic::encoders::ColMatrixEncoder< T >:

Public Member Functions

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

Protected Attributes

size_t matrix_height
 Height of the matrix - number of rows. More...
 
size_t matrix_width
 Width of the matrix - number of columns. More...
 
- Protected Attributes inherited from mic::encoders::MatrixSDREncoder< mic::types::Matrix< T >, T >
size_t sdr_length
 Length of SDR. More...
 

Detailed Description

template<typename T = float>
class mic::encoders::ColMatrixEncoder< T >

Encoder responsible for encoding single channel (float) matrices (e.g. grayscale images) into SDRs. There is no learning (auto-encoding), instead it simply transforms matrix of floats into a vector.

Author
tkornuta

Definition at line 38 of file ColMatrixEncoder.hpp.

Constructor & Destructor Documentation

template<typename T = float>
mic::encoders::ColMatrixEncoder< T >::ColMatrixEncoder ( size_t  matrix_height_,
size_t  matrix_width_ 
)
inline

Default constructor. Sets the encoding parameters.

Parameters
matrix_width_Width of the matrix.
matrix_height_Height of the matrix.

Definition at line 46 of file ColMatrixEncoder.hpp.

template<typename T = float>
mic::encoders::ColMatrixEncoder< T >::~ColMatrixEncoder ( )
inline

Default destructor - empty.

Definition at line 54 of file ColMatrixEncoder.hpp.

Member Function Documentation

template<typename T = float>
virtual mic::types::MatrixPtr<T> mic::encoders::ColMatrixEncoder< T >::decodeSample ( const mic::types::MatrixPtr< T > &  sdr_)
inlinevirtual

Method responsible for decoding of SDR into data.

Parameters
[in]sdr_Shared pointer to SDR (1D matrix).
Returns
Shared pointer to a 2D matrix.

Definition at line 76 of file ColMatrixEncoder.hpp.

References mic::encoders::ColMatrixEncoder< T >::matrix_height, and mic::encoders::ColMatrixEncoder< T >::matrix_width.

template<typename T = float>
virtual mic::types::MatrixPtr<T> mic::encoders::ColMatrixEncoder< T >::encodeSample ( const mic::types::MatrixPtr< T > &  sample_)
inlinevirtual

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

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

Definition at line 61 of file ColMatrixEncoder.hpp.

References mic::encoders::MatrixSDREncoder< mic::types::Matrix< T >, T >::sdr_length.

Member Data Documentation

template<typename T = float>
size_t mic::encoders::ColMatrixEncoder< T >::matrix_height
protected

Height of the matrix - number of rows.

Definition at line 88 of file ColMatrixEncoder.hpp.

Referenced by mic::encoders::ColMatrixEncoder< T >::decodeSample().

template<typename T = float>
size_t mic::encoders::ColMatrixEncoder< T >::matrix_width
protected

Width of the matrix - number of columns.

Definition at line 91 of file ColMatrixEncoder.hpp.

Referenced by mic::encoders::ColMatrixEncoder< T >::decodeSample().


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