#include <neural++.hpp>
Public Member Functions | |
Neuron (double(*a)(double), double(*d)(double)) | |
Constructor. | |
Neuron (vector< Synapsis > in, vector< Synapsis > out, double(*a)(double), double(*d)(double)) | |
Alternative constructor, that gets also the synapsis linked to the neuron. | |
Synapsis & | synIn (size_t i) |
Get the i-th synapsis connected on the input of the neuron. | |
Synapsis & | synOut (size_t i) |
Get the i-th synapsis connected on the output of the neuron. | |
void | push_in (Synapsis &s) |
It pushes a new input synapsis. | |
void | push_out (Synapsis &s) |
It pushes a new output synapsis. | |
void | setActv (double a) |
Change the activation value of the neuron. | |
void | setProp (double p) |
Change the propagation value of the neuron. | |
double | getActv () |
Get the activation value of the neuron. | |
double | getProp () |
Get the propagation value of the neuron. | |
double | propagate () |
It propagates its activation value to the connected neurons. | |
size_t | nIn () |
Get the number of input synapsis for the neuron. | |
size_t | nOut () |
Get the number of output synapsis for the neuron. | |
void | synClear () |
Remove input and output synapsis from a neuron. | |
Private Attributes | |
double | actv_val |
double | prop_val |
vector< Synapsis > | in |
vector< Synapsis > | out |
double(* | actv_f )(double) |
double(* | deriv )(double) |
Don't use this class directly unless you know what you're doing, use NeuralNet instead
neuralpp::Neuron::Neuron | ( | double(*)(double) | a, | |
double(*)(double) | d | |||
) |
Constructor.
a | Activation function | |
d | Its derivate |
neuralpp::Neuron::Neuron | ( | vector< Synapsis > | in, | |
vector< Synapsis > | out, | |||
double(*)(double) | a, | |||
double(*)(double) | d | |||
) |
Alternative constructor, that gets also the synapsis linked to the neuron.
in | Input synapses | |
out | Output synapses | |
a | Activation function | |
d | Derivate of the activation function |
Synapsis& neuralpp::Neuron::synIn | ( | size_t | i | ) |
Get the i-th synapsis connected on the input of the neuron.
i | Index of the input synapsis to get |
Synapsis& neuralpp::Neuron::synOut | ( | size_t | i | ) |
Get the i-th synapsis connected on the output of the neuron.
i | Index of the output synapsis to get |
void neuralpp::Neuron::push_in | ( | Synapsis & | s | ) |
void neuralpp::Neuron::push_out | ( | Synapsis & | s | ) |
void neuralpp::Neuron::setActv | ( | double | a | ) |
Change the activation value of the neuron.
a | Activation value |
void neuralpp::Neuron::setProp | ( | double | p | ) |
Change the propagation value of the neuron.
p | Propagation value |
double neuralpp::Neuron::getActv | ( | ) |
Get the activation value of the neuron.
double neuralpp::Neuron::getProp | ( | ) |
Get the propagation value of the neuron.
double neuralpp::Neuron::propagate | ( | ) |
It propagates its activation value to the connected neurons.
size_t neuralpp::Neuron::nIn | ( | ) |
Get the number of input synapsis for the neuron.
size_t neuralpp::Neuron::nOut | ( | ) |
Get the number of output synapsis for the neuron.
void neuralpp::Neuron::synClear | ( | ) |
Remove input and output synapsis from a neuron.
double neuralpp::Neuron::actv_val [private] |
double neuralpp::Neuron::prop_val [private] |
vector< Synapsis > neuralpp::Neuron::in [private] |
vector< Synapsis > neuralpp::Neuron::out [private] |
double(* neuralpp::Neuron::actv_f)(double) [private] |
double(* neuralpp::Neuron::deriv)(double) [private] |