-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNeuron.h
executable file
·59 lines (36 loc) · 928 Bytes
/
Neuron.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
/*
File: Neuron.cpp
Author: Gabriela Mattos
Resume: Implementation of the neuron. Neurons are the nodes found in perceptrons.
*/
#include <cfloat> // DBL_MAX
#include <cmath> // std::nextafter
#include <random>
#include <iostream>
//razão de aprendizado
#define gain 0.1
using namespace std;
class Neuron
{
public:
float value;
//os pesos são correspondente a próxima camada, logo a camada de saída por não ter sinapse com prox não tera vetores de pesos.
int numberSynapses; //Remember that it is a neural net complety
float *weight;
float threshold;
float error;
float d;
Neuron();
~Neuron();
void setValue(float);
float getValue();
float getWeight(int);
void setD(float);
float getD();
float getError();
float getThreshold();
void initializesWeightThreshold(int);
void adaptValue(float);
void calculatesError(bool, float);
void adjustWeight();
};