-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMLP_Network.h
43 lines (31 loc) · 895 Bytes
/
MLP_Network.h
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
#ifndef MLP_Network_H
#define MLP_Network_H
#include "MLP_Layer.h"
#include <iostream>
#include <ctime>
#include <cmath>
#include <vector>
#include <fstream>
using namespace std;
class MLP_Network {
private:
MLP_Layer *layerNetwork;
int nTrainingSet;
int nInputUnit;
int nHiddenUnit;
int nOutputUnit;
int nHiddenLayer;
public:
MLP_Network(){}
~MLP_Network(){Delete();}
void Allocate(int nInputUnit, int nHiddenUnit, int nOutputUnit, int nHiddenLayer,
int nTrainingSet);
void Delete();
void Train();
void ForwardPropagateNetwork(float* inputNetwork);
void BackwardPropagateNetwork(float* desiredOutput);
void UpdateWeight(float learningRate);
float CostFunction(float* inputNetwork,float* desiredOutput);
float CalculateResult(float* inputNetwork,float* desiredOutput);
};
#endif