MachineIntelligenceCore:Algorithms
|
Template class storing the data-label pairs. Additionally it stores the the index of the sample (mainly for debug purposes). More...
#include <Sample.hpp>
Public Member Functions | |
Sample () | |
Sample (std::shared_ptr< DataType > data_, std::shared_ptr< LabelType > label_, size_t index_=-1) | |
Sample (const mic::types::Sample< DataType, LabelType > &sample_) | |
mic::types::Sample< DataType, LabelType > & | operator= (const mic::types::Sample< DataType, LabelType > &sample_) |
virtual | ~Sample () |
std::shared_ptr< DataType > | data () const |
Returns the sample data. More... | |
std::shared_ptr< LabelType > | label () const |
Returns the returns the sample label. More... | |
size_t | index () const |
Returns the sample number (the sample "position" in original dataset). More... | |
Private Attributes | |
std::shared_ptr< DataType > | sample_data |
Stores the data. More... | |
std::shared_ptr< LabelType > | sample_label |
Stores the label. More... | |
size_t | sample_index |
The sample index (the sample "position" in original dataset). More... | |
Template class storing the data-label pairs. Additionally it stores the the index of the sample (mainly for debug purposes).
DataType | Template parameter defining the sample data type. |
LabelType | Template parameters defining the sample label label. |
Definition at line 38 of file Sample.hpp.
|
inline |
Constructor without parameters - nulls both data and label pointers and set index to -1.
Definition at line 44 of file Sample.hpp.
|
inline |
Constructor.
Definition at line 52 of file Sample.hpp.
|
inline |
|
inlinevirtual |
Destructor. Empty for now.
Definition at line 77 of file Sample.hpp.
|
inline |
Returns the sample data.
Definition at line 80 of file Sample.hpp.
References mic::types::Sample< DataType, LabelType >::sample_data.
Referenced by mic::types::Batch< mic::types::MatrixXf, unsigned int >::add(), and main().
|
inline |
Returns the sample number (the sample "position" in original dataset).
Definition at line 90 of file Sample.hpp.
References mic::types::Sample< DataType, LabelType >::sample_index.
Referenced by mic::types::Batch< mic::types::MatrixXf, unsigned int >::add().
|
inline |
Returns the returns the sample label.
Definition at line 85 of file Sample.hpp.
References mic::types::Sample< DataType, LabelType >::sample_label.
Referenced by mic::types::Batch< mic::types::MatrixXf, unsigned int >::add(), and main().
|
inline |
Assignment operator - sets pointers and number.
sample_ | Sample to be copied. |
Definition at line 65 of file Sample.hpp.
References mic::types::Sample< DataType, LabelType >::sample_data, mic::types::Sample< DataType, LabelType >::sample_index, and mic::types::Sample< DataType, LabelType >::sample_label.
|
private |
Stores the data.
Definition at line 96 of file Sample.hpp.
Referenced by mic::types::Sample< DataType, LabelType >::data(), and mic::types::Sample< DataType, LabelType >::operator=().
|
private |
The sample index (the sample "position" in original dataset).
Definition at line 102 of file Sample.hpp.
Referenced by mic::types::Sample< DataType, LabelType >::index(), and mic::types::Sample< DataType, LabelType >::operator=().
|
private |
Stores the label.
Definition at line 99 of file Sample.hpp.
Referenced by mic::types::Sample< DataType, LabelType >::label(), and mic::types::Sample< DataType, LabelType >::operator=().