shark::LabeledDataDistribution< InputType, LabelType > Class Template Referenceabstract

A LabeledDataDistribution defines a supervised learning problem. More...

#include <shark/Data/DataDistribution.h>

Public Member Functions

virtual ~LabeledDataDistribution ()
 Virtual destructor. More...
 
virtual void draw (InputType &input, LabelType &label) const =0
 Generates a single pair of input and label. More...
 
std::pair< InputType, LabelType > operator() ()
 
LabeledData< InputType, LabelType > generateDataset (std::size_t size, std::size_t maximumBatchSize) const
 Generates a dataset with samples from from the distribution. More...
 
LabeledData< InputType, LabelType > generateDataset (std::size_t size) const
 Generates a data set with samples from from the distribution. More...
 

Detailed Description

template<class InputType, class LabelType>
class shark::LabeledDataDistribution< InputType, LabelType >

A LabeledDataDistribution defines a supervised learning problem.

The supervised learning problem is defined by an explicit distribution (in contrast to a finite dataset). The only method we need is to draw a sample from the distribution.

Definition at line 108 of file DataDistribution.h.

Constructor & Destructor Documentation

◆ ~LabeledDataDistribution()

template<class InputType, class LabelType>
virtual shark::LabeledDataDistribution< InputType, LabelType >::~LabeledDataDistribution ( )
inlinevirtual

Virtual destructor.

Definition at line 112 of file DataDistribution.h.

Member Function Documentation

◆ draw()

template<class InputType, class LabelType>
virtual void shark::LabeledDataDistribution< InputType, LabelType >::draw ( InputType input,
LabelType &  label 
) const
pure virtual

Generates a single pair of input and label.

Parameters
inputthe generated input
labelthe generated label

Implemented in shark::DiagonalWithCircle, shark::CircleInSquare, shark::PamiToy, shark::Wave, and shark::Chessboard.

◆ generateDataset() [1/2]

template<class InputType, class LabelType>
LabeledData<InputType, LabelType> shark::LabeledDataDistribution< InputType, LabelType >::generateDataset ( std::size_t  size,
std::size_t  maximumBatchSize 
) const
inline

Generates a dataset with samples from from the distribution.

Parameters
sizethe number of samples in the dataset
maximumBatchSizethe maximum size of a batch

Definition at line 130 of file DataDistribution.h.

Referenced by main(), and run_one_trial().

◆ generateDataset() [2/2]

template<class InputType, class LabelType>
LabeledData<InputType, LabelType> shark::LabeledDataDistribution< InputType, LabelType >::generateDataset ( std::size_t  size) const
inline

Generates a data set with samples from from the distribution.

Parameters
sizethe number of samples in the dataset

Definition at line 145 of file DataDistribution.h.

◆ operator()()

template<class InputType, class LabelType>
std::pair<InputType,LabelType> shark::LabeledDataDistribution< InputType, LabelType >::operator() ( )
inline

Definition at line 120 of file DataDistribution.h.


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