-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathNeuralNetwork.h
62 lines (54 loc) · 1.77 KB
/
NeuralNetwork.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
#ifndef NEURALNETWORK_H
#define NEURALNETWORK_H
#include "Reservoir.h"
#include "Neuron.h"
#include "utils.h"
#include "global.h"
#include <vector>
class NeuralNetwork
{
public:
/**
* @brief Default Constructor
*/
NeuralNetwork();
/**
* @brief Constructor that initializes its neurons based on the file read.
* @arg filename Accepts a string for the file name of the network matrix.
*/
NeuralNetwork(char* filename); // Might not use.
void linkSensor(Neuron* sensor, Neuron* target);
void linkMotor(Neuron* target, Neuron* motor);
void linkReservoir(Neuron* source, Neuron* target);
void trainAND();
void trainOR();
void trainXOR();
void trainMNIST(int numTrain, int numTest);
void updateSensors(std::vector<float> values);
void updateSensorsMNIST(int** values);
void process(bool train);
void updateCues(Neuron* motor, bool reinforce); // If reinforce is true, cues will be decreased.
void determineState(); // This is to make the net learn "autonomously".
void outputMotors();
void resetMotorTriggers();
/** Default destructor */
virtual ~NeuralNetwork();
protected:
private:
int numReservoirs;
int resDimension;
int numSensors;
int numMotors;
int maxInputs;
int maxAxonLength;
int maxSynapses;
bool criticalPeriod;
bool sensitivityPeriod;
// Neuron* sensors[NUM_SENSORS];
std::vector<Neuron*> sensors;
// Reservoir* reservoir[NUM_RESERVOIRS];
std::vector<Reservoir*> reservoir;
// Neuron* motors[NUM_MOTORS];
std::vector<Neuron*> motors;
};
#endif // NEURALNETWORK_H