#define __WINDOWS__ 1
#include <iostream>
#include <algorithm>
#include <string>
#include "libidxgui.h"
#include "datasource.h"
#include "libidx.h"
#include "idx.h"
uint dump_count = 0;
using namespace std;
using namespace ebl;
void test_mnist_LabeledDataSource();
int main(int argc,char** argv)
{
test_mnist_LabeledDataSource();
return 0;
}
void test_mnist_LabeledDataSource()
{
string datafile = "F:/eblearn/mnist";
string labelfile = "F:/eblearn/mnist";
datafile += "/t10k-images-idx3-ubyte";
labelfile += "/t10k-labels-idx1-ubyte";
idx<ubyte> data = load_matrix<ubyte>(datafile);
idx<ubyte> labels = load_matrix<ubyte>(labelfile);
labeled_datasource<double,ubyte,ubyte> ds(data, labels);
state<double> datum(28, 28);
state<ubyte> label;
for (int i = 0; i < 5; i++)
{
ds.fprop_data(datum);
ds.fprop_label(label);
cout<<"Datum:"<<endl;
datum.printElems();
cout<<"Label: ";
label.printElems();
cout<<endl;
ds.next();
}
}