-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMlpNetwork.h
More file actions
47 lines (41 loc) · 1.01 KB
/
MlpNetwork.h
File metadata and controls
47 lines (41 loc) · 1.01 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
//MlpNetwork.h
#ifndef MLPNETWORK_H
#define MLPNETWORK_H
#include "Matrix.h"
#include "Digit.h"
#include "Dense.h"
#define MLP_SIZE 4
const MatrixDims imgDims = {28 , 28};
const MatrixDims weightsDims[] = {{128 , 784} ,
{64 , 128} ,
{20 , 64} ,
{10 , 20}};
const MatrixDims biasDims[] = {{128 , 1} ,
{64 , 1} ,
{20 , 1} ,
{10 , 1}};
/**
* MlpNetwork object
*/
class MlpNetwork
{
public:
/**
* Accepts 2 arrays, size 4 each
* @param weights : Weights array
* @param bias : bias array
*/
MlpNetwork(Matrix *weights , Matrix *bias);
/**
* Applies the entire network on input
* @param img :Matrix to activate the layers.
* @return Matrix after layer activation.
*/
Digit operator()(Matrix & img);
private:
Dense first;
Dense second;
Dense third;
Dense fourth;
};
#endif // MLPNETWORK_H