-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNeural.h
86 lines (70 loc) · 2.34 KB
/
Neural.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
neural.h - Library for Neural Network.
Created by Stuart Cording, Sept 9th, 2017.
Released into the public domain.
*/
#ifndef Neural_h
#define Neural_h
#include "Arduino.h"
class Neural
{
private:
double* inputNodeValues;
double* hiddenNodeValues;
double* outputNodeValues;
double* desiredOutputNodeValues;
int noOfInputs;
int noOfHidden;
int noOfOutputs;
double** inputToHiddenWeights;
double** newInputToHiddenWeights;
double** hiddenToOutputWeights;
double** newHiddenToOutputWeights;
double biasInputToHidden;
double biasHiddenToOutput;
double learningRate;
double totalNetworkError;
int learningEpoch;
boolean learning;
boolean verbose;
void _backPropagation();
public:
Neural(int inputs, int hidden, int outputs);
void calculateOutput();
void setLearningRate(double bias);
double getLearningRate();
void setBiasInputToHidden(double bias);
double getBiasInputToHidden();
void setBiasHiddenToOutput(double bias);
double getBiasHiddenToOutput();
void turnLearningOn();
void turnLearningOff();
void setInputNode(int node, double value);
double getInputNode(int node);
void setOutputNodeDesired(int node, double value);
double getOutputNodeDesired(int node);
int getNoOfInputNodes();
int getNoOfHiddenNodes();
int getNoOfOutputNodes();
double getOutputNode(int node);
void displayInputToHiddenWeightsCurrent();
void displayHiddenToOutputWeightsCurrent();
void turnVerboseOn();
void turnVerboseOff();
double getTotalNetworkError();
int getEpoch();
void setInputToHiddenWeight(int input, int hidden, double value);
double getInputToHiddenWeight(int input, int hidden);
void setHiddenToOutputWeight(int hidden, int output, double value);
double getHiddenToOutputWeight(int hidden, int output);
boolean getLearningStatus();
void displayInputNodes();
void displayHiddenNodes();
void displayOutputNodes();
/*
void seed(int x) {
randomSeed(x);
}
*/
};
#endif