#include <neural++.hpp>
Public Member Functions | |
Synapsis (Neuron *i, Neuron *o, double w, double d) | |
Constructor. | |
Synapsis (Neuron *i, Neuron *o, double(*a)(double)) | |
Constructor. | |
Synapsis (Neuron *i, Neuron *o, double w, double(*a)(double)) | |
Constructor. | |
Neuron * | getIn () const |
Neuron * | getOut () const |
void | setWeight (double w) throw (InvalidSynapticalWeightException) |
Set the weight of the synapsis. | |
void | setDelta (double d) throw (InvalidSynapticalWeightException) |
It sets the delta (how much to change the weight after an update) of the synapsis. | |
double | getWeight () const |
Return the weight of the synapsis. | |
double | getDelta () const |
Return the delta of the synapsis. | |
double | getPrevDelta () const |
Get the delta of the synapsis at the previous iteration. | |
double | momentum (int N, int x) const |
Get the inertial momentum of a synapsis. | |
Private Attributes | |
double | delta |
double | prev_delta |
double | weight |
Neuron * | in |
Neuron * | out |
double(* | actv_f )(double) |
Don't use this class directly unless you know what you're doing, use NeuralNet instead
Constructor.
i | Input neuron | |
o | Output neuron | |
w | Weight for the synapsis | |
d | Delta for the synapsis |
Constructor.
i | Input neuron | |
o | Output neuron | |
a | Activation function |
Constructor.
i | Input neuron | |
o | Output neuron | |
w | Weight for the synapsis (default: random) | |
a | Activation function |
Neuron* neuralpp::Synapsis::getIn | ( | ) | const |
Neuron* neuralpp::Synapsis::getOut | ( | ) | const |
void neuralpp::Synapsis::setWeight | ( | double | w | ) | throw (InvalidSynapticalWeightException) |
Set the weight of the synapsis.
w | Weight to be set |
void neuralpp::Synapsis::setDelta | ( | double | d | ) | throw (InvalidSynapticalWeightException) |
It sets the delta (how much to change the weight after an update) of the synapsis.
d | Delta to be set |
double neuralpp::Synapsis::getWeight | ( | ) | const |
Return the weight of the synapsis.
double neuralpp::Synapsis::getDelta | ( | ) | const |
Return the delta of the synapsis.
double neuralpp::Synapsis::getPrevDelta | ( | ) | const |
Get the delta of the synapsis at the previous iteration.
double neuralpp::Synapsis::momentum | ( | int | N, | |
int | x | |||
) | const |
Get the inertial momentum of a synapsis.
This value is inversely proportional to the number of steps done in the learning phase (quite high at the beginning, decreasing to zero towards the end of the learning algorithm), and is needed to avoid strong oscillations in output values at the beginning, caused by the random values assigned to the synaptical weights
N | The number of iterations the network must have to adjust the output values | |
x | The number of iterations already taken |
double neuralpp::Synapsis::delta [private] |
double neuralpp::Synapsis::prev_delta [private] |
double neuralpp::Synapsis::weight [private] |
Neuron* neuralpp::Synapsis::in [private] |
Neuron* neuralpp::Synapsis::out [private] |
double(* neuralpp::Synapsis::actv_f)(double) [private] |