#include <neural++.hpp>
Public Member Functions | |
Neuron (double(*a)(double), double th=0.0) | |
Constructor. | |
Neuron (std::vector< Synapsis > in, std::vector< Synapsis > out, double(*a)(double), double th=0.0) | |
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. | |
void | setSynIn (size_t n) |
void | setSynOut (size_t n) |
double | getActv () |
Get the activation value of the neuron. | |
double | getProp () |
Get the propagation value of the neuron. | |
void | propagate () |
Compute the propagation value of the neuron and set it. | |
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 |
double | threshold |
std::vector< Synapsis > | in |
std::vector< Synapsis > | out |
double(* | actv_f )(double) |
Don't use this class directly unless you know what you're doing, use NeuralNet instead
neuralpp::Neuron::Neuron | ( | double(*)(double) | a, | |
double | th = 0.0 | |||
) |
Constructor.
a | Activation function | |
th | Threshold, value in [0,1] that establishes how much a neuron must be 'sensitive' on variations of the input values |
neuralpp::Neuron::Neuron | ( | std::vector< Synapsis > | in, | |
std::vector< Synapsis > | out, | |||
double(*)(double) | a, | |||
double | th = 0.0 | |||
) |
Alternative constructor, that gets also the synapsis linked to the neuron.
in | Input synapses | |
out | Output synapses | |
a | Activation function | |
th | Threshold, value in [0,1] that establishes how much a neuron must be 'sensitive' on variations of the input values |
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 |
void neuralpp::Neuron::setSynIn | ( | size_t | n | ) |
void neuralpp::Neuron::setSynOut | ( | size_t | n | ) |
double neuralpp::Neuron::getActv | ( | ) |
Get the activation value of the neuron.
double neuralpp::Neuron::getProp | ( | ) |
Get the propagation value of the neuron.
void neuralpp::Neuron::propagate | ( | ) |
Compute the propagation value of the neuron and set it.
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] |
double neuralpp::Neuron::threshold [private] |
std::vector< Synapsis > neuralpp::Neuron::in [private] |
std::vector< Synapsis > neuralpp::Neuron::out [private] |
double(* neuralpp::Neuron::actv_f)(double) [private] |