libeblearn
|
#include <datasource.h>
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'. |
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).
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.
size | The number of samples to use, can go up to 10k for testing and 60k for training. |
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
size | The number of samples to use, can go up to 10k for testing and 60k for training. |