-
Notifications
You must be signed in to change notification settings - Fork 0
/
RedeNeural.h
62 lines (49 loc) · 1.55 KB
/
RedeNeural.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
// Leonardo Antonetti da Motta - ICMC USP 11275338
#include <iostream>
#include <vector>
#include <list>
#include <cstdlib>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#define MIN_AXON -1
#define MAX_AXON 1
//#define ESCOPO_DECIMAL_AXON 100
#define N_INPUTS 6
#define N_NEURONS 4
#define N_OUTPUTS 2
class RedeNeural {
public:
typedef struct
{
double axonsIn[N_INPUTS][N_NEURONS]; // [x][y] -> [x] eh para o input, signifca qual input veio, [y] eh para neuronio, signifca para qual neuronio vai
double axonsOut[N_NEURONS][N_OUTPUTS]; // [x][y] -> [x] eh para o neuronio, signifca qual neuronio veio, [y] eh para output, signifca para qual output vai
} structAxons;
private:
double input[N_INPUTS], output[N_OUTPUTS];
double neuron[N_NEURONS];
structAxons axons;
double biasNeuron, biasOutput;
public:
RedeNeural(double _input[], double _biasNeuron, double _biasOutput);
double* getInput();
double* getOutput();
structAxons getAxons();
double* getNeuron();
double getBiasNeuron();
double getBiasOutput();
void setInput(double _input[]);
void setOutput(double _output[]);
void setAxonsIn(double _axonsIn[][N_NEURONS]);
void setAxonsOut(double _axonsOut[][N_OUTPUTS]);
void setNeuron(double _neuron[]);
void setBiasNeuron(double _biasNeuron);
void setBiasOutput(double _biasOutput);
void populateAxons();
double sigmoid(double x);
void activatingFunction(double source[], int size);
double feedForward();
void printExample();
};