-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmnistHelper.h
More file actions
34 lines (30 loc) · 759 Bytes
/
mnistHelper.h
File metadata and controls
34 lines (30 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef MNIST_HELPER
#define MNIST_HELPER
#include<cstring>
#include <vector>
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <time.h>
#include "Matrix.h"
#include "mnistImage.h"
#include <fstream>
using namespace std;
class MNISTHelper {
public:
MNISTHelper(char imageFileName[], char labelFileName[]);
MNISTHelper();
vector<MNISTImage> getAll();
MNISTImage getNext();
int reverseInt (int i);
void printImageMatrix(Matrix<double> img, int width, int height);
int n_rows = 0;
int n_cols = 0;
int magic_number = 0;
int number_of_images = 0;
int currentImageIndex = -1;
private:
ifstream imageFile;
ifstream labelFile;
};
#endif