SuperNN
1.0.0
|
Neuron, that can contain connections to neurons in the next layers. More...
Public Member Functions | |
Neuron (bool _b=false) | |
Constructor. More... | |
virtual | ~Neuron () |
void | connect (unsigned to_layer, unsigned to_neuron) |
Adds a connection to a neuron. More... | |
const Connection & | operator[] (unsigned c) const |
Returns a const reference to a connection. More... | |
Connection & | operator[] (unsigned c) |
Returns a reference to a connection. More... | |
void | set_activation (ActFuncType type, double s=1) |
Sets the neuron activation function. More... | |
unsigned | size () const |
Returns the number of synaptic connections. More... | |
Public Attributes | |
ActFuncType | act_func |
Used activation function. More... | |
bool | bias |
Marks if it's a bias neuron. More... | |
std::vector< Connection > | conns |
Synaptic connections. More... | |
double | delta |
Last local error gradient. More... | |
bool | delta_ok |
Marks if the delta has been calculated for the current iteration. More... | |
double | err |
Last error (desired - actual). More... | |
double | net |
Last sum of the neuron inputs. More... | |
double | out |
Last output of the neuron ( g(net) ) More... | |
double | steep |
Activation function steepness. More... | |
Neuron, that can contain connections to neurons in the next layers.
Definition at line 70 of file neuron.hpp.
SuperNN::Neuron::Neuron | ( | bool | _b = false | ) |
Constructor.
Bias neurons (acts like an input neuron with fixed input of 1) should be placed in the input layer. There's no need for more than one bias neuron, as neurons can be connected to any neuron in any next layer.
_b | Marks if the neuron is a bias neuron |
Definition at line 41 of file neuron.cpp.
|
virtual |
Definition at line 37 of file neuron.cpp.
void SuperNN::Neuron::connect | ( | unsigned | to_layer, |
unsigned | to_neuron | ||
) |
Adds a connection to a neuron.
to_layer | Layer where the target neuron is located |
to_neuron | Position of the target neuron in it's layer |
Definition at line 46 of file neuron.cpp.
|
inline |
Returns a const reference to a connection.
c | Connection position |
Definition at line 90 of file neuron.hpp.
|
inline |
Returns a reference to a connection.
c | Connection position |
Definition at line 101 of file neuron.hpp.
void SuperNN::Neuron::set_activation | ( | ActFuncType | type, |
double | s = 1 |
||
) |
Sets the neuron activation function.
type | Activation function type |
s | Activation function steepness |
Definition at line 51 of file neuron.cpp.
|
inline |
Returns the number of synaptic connections.
Definition at line 111 of file neuron.hpp.
ActFuncType SuperNN::Neuron::act_func |
Used activation function.
Definition at line 148 of file neuron.hpp.
bool SuperNN::Neuron::bias |
Marks if it's a bias neuron.
Definition at line 157 of file neuron.hpp.
std::vector<Connection> SuperNN::Neuron::conns |
Synaptic connections.
Definition at line 133 of file neuron.hpp.
double SuperNN::Neuron::delta |
Last local error gradient.
Definition at line 145 of file neuron.hpp.
bool SuperNN::Neuron::delta_ok |
Marks if the delta has been calculated for the current iteration.
Definition at line 154 of file neuron.hpp.
double SuperNN::Neuron::err |
double SuperNN::Neuron::net |
Last sum of the neuron inputs.
Definition at line 136 of file neuron.hpp.
double SuperNN::Neuron::out |
Last output of the neuron ( g(net) )
Definition at line 139 of file neuron.hpp.
double SuperNN::Neuron::steep |
Activation function steepness.
Definition at line 151 of file neuron.hpp.