Direct Graphical Models  v.1.5.3
DirectGraphicalModels::CSamplesAccumulator Class Reference

Samples accumulator abstract class. More...

#include <SamplesAccumulator.h>

Public Member Functions

 CSamplesAccumulator (byte nStates, size_t maxSamples)
 Constructor. More...
 
 CSamplesAccumulator (const CSamplesAccumulator &)=delete
 
 ~CSamplesAccumulator (void)
 
CSamplesAccumulatoroperator= (const CSamplesAccumulator &)=delete
 
void reset (void)
 Resets the accumulator. More...
 
void addSample (const Mat &featureVector, byte state)
 Adds new sample to the accumulator. More...
 
Mat getSamplesContainer (byte state) const
 Returns samples container for the state (class) state. More...
 
int getNumSamples (byte state) const
 Returns the number of stored samples in container for the state (class) state. More...
 
int getNumInputSamples (byte state) const
 Returns the number of input samples in container for the state (class) state. More...
 
void release (byte state)
 Releases memory of container for the state (class) state. More...
 

Protected Attributes

vec_mat_t m_vSamplesAcc
 
vec_int_t m_vNumInputSamples
 
int m_maxSamples
 

Detailed Description

Samples accumulator abstract class.

This class allows for storing samples (e.g. n-dimensinal points in feature space) into the memory

Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 15 of file SamplesAccumulator.h.

Constructor & Destructor Documentation

◆ CSamplesAccumulator() [1/2]

DirectGraphicalModels::CSamplesAccumulator::CSamplesAccumulator ( byte  nStates,
size_t  maxSamples 
)
inline

Constructor.

Parameters
nStatesNumber of states (classes)
maxSamplesMaximum number of samples to be used in training.

Default value 0 means using all the samples.
If another value is specified, the class for training will use maxSamples random samples from the whole amount of samples, added via addSample() function

Definition at line 25 of file SamplesAccumulator.h.

◆ CSamplesAccumulator() [2/2]

DirectGraphicalModels::CSamplesAccumulator::CSamplesAccumulator ( const CSamplesAccumulator )
delete

◆ ~CSamplesAccumulator()

DirectGraphicalModels::CSamplesAccumulator::~CSamplesAccumulator ( void  )
inline

Definition at line 31 of file SamplesAccumulator.h.

Member Function Documentation

◆ addSample()

void DirectGraphicalModels::CSamplesAccumulator::addSample ( const Mat &  featureVector,
byte  state 
)

Adds new sample to the accumulator.

Parameters
featureVectorMulti-dimensinal point: Mat(size: nFeatures x 1)
stateState (class) corresponding to the featureVector

Definition at line 13 of file SamplesAccumulator.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumInputSamples()

int DirectGraphicalModels::CSamplesAccumulator::getNumInputSamples ( byte  state) const

Returns the number of input samples in container for the state (class) state.

This function retunts the number of samples added with the addSample() function. Please note, that this number may be larger than the number of samples, actually stored in container, that may me true, if the constructor's argument maxSamples was specified. than the output of the getNumSamples()

Parameters
stateThe state (class)
Returns
The number of samples

Definition at line 35 of file SamplesAccumulator.cpp.

Here is the caller graph for this function:

◆ getNumSamples()

int DirectGraphicalModels::CSamplesAccumulator::getNumSamples ( byte  state) const

Returns the number of stored samples in container for the state (class) state.

Parameters
stateThe state (class)
Returns
The number of samples

Definition at line 29 of file SamplesAccumulator.cpp.

Here is the caller graph for this function:

◆ getSamplesContainer()

Mat DirectGraphicalModels::CSamplesAccumulator::getSamplesContainer ( byte  state) const
inline

Returns samples container for the state (class) state.

Parameters
stateThe state (class)
Returns
The container: Mat(size: nSamples x nFeatures)

Definition at line 50 of file SamplesAccumulator.h.

Here is the caller graph for this function:

◆ operator=()

CSamplesAccumulator& DirectGraphicalModels::CSamplesAccumulator::operator= ( const CSamplesAccumulator )
delete

◆ release()

void DirectGraphicalModels::CSamplesAccumulator::release ( byte  state)

Releases memory of container for the state (class) state.

Parameters
stateThe state (class)

Definition at line 41 of file SamplesAccumulator.cpp.

Here is the caller graph for this function:

◆ reset()

void DirectGraphicalModels::CSamplesAccumulator::reset ( void  )

Resets the accumulator.

Definition at line 7 of file SamplesAccumulator.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ m_maxSamples

int DirectGraphicalModels::CSamplesAccumulator::m_maxSamples
protected

Definition at line 77 of file SamplesAccumulator.h.

◆ m_vNumInputSamples

vec_int_t DirectGraphicalModels::CSamplesAccumulator::m_vNumInputSamples
protected

Definition at line 76 of file SamplesAccumulator.h.

◆ m_vSamplesAcc

vec_mat_t DirectGraphicalModels::CSamplesAccumulator::m_vSamplesAcc
protected

Definition at line 75 of file SamplesAccumulator.h.


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