libeblearn
ebl::mnist_datasource< Tnet, Tdata, Tlabel > Class Template Reference

#include <datasource.h>

Inheritance diagram for ebl::mnist_datasource< Tnet, Tdata, Tlabel >:
ebl::class_datasource< Tnet, Tdata, Tlabel > ebl::labeled_datasource< Tnet, Tdata, Tlabel > ebl::datasource< Tnet, Tdata >

List of all members.

Public Member Functions

 mnist_datasource (const char *root, bool train_data, uint size)
 mnist_datasource (const char *root, const char *name, uint size)
virtual ~mnist_datasource ()
 Destructor.
virtual void fprop_data (bbstate_idx< Tnet > &s)
 Copy current sample's data into s.

Protected Member Functions

virtual void init (idx< Tdata > &data, idx< Tlabel > &labels, const char *name)
 Initialize with 'data' and 'labels', and an optional 'name'.

Detailed Description

template<typename Tnet, typename Tdata, typename Tlabel>
class ebl::mnist_datasource< Tnet, Tdata, Tlabel >

A datasource specific to the MNIST dataset. The specific operations for MNIST are padding the data from 28x28 to 32x32 and multiplying it by a coefficient of .01 (brining the input range from [0,255] to [0,2.55] (the coefficient and bias can be overriden via the inherited set_data_coeff() and set_data_bias() methods).


Constructor & Destructor Documentation

template<typename Tnet , typename Tdata , typename Tlabel >
ebl::mnist_datasource< Tnet, Tdata, Tlabel >::mnist_datasource ( const char *  root,
bool  train_data,
uint  size 
)

Create an MNIST dataset using the original MNIST filenames, in 'root' directory. Set 'train_data' to true to load the training data, false to load the testing data.

Parameters:
sizeThe number of samples to use, can go up to 10k for testing and 60k for training.
template<typename Tnet , typename Tdata , typename Tlabel >
ebl::mnist_datasource< Tnet, Tdata, Tlabel >::mnist_datasource ( const char *  root,
const char *  name,
uint  size 
)

Create an MNIST dataset using files found in root directory. Name can be used to differentiate between training, testing and validataion data. The file name will be constructed as follow: {root}/{name}_{data|labels}.mat

Parameters:
sizeThe number of samples to use, can go up to 10k for testing and 60k for training.

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