#include <neural++.hpp>
Public Member Functions | |
Layer (size_t sz, double(*a)(double), double th=0.0) | |
Constructor. | |
Layer (std::vector< Neuron > &neurons, double(*a)(double), double th=0.0) | |
Alternative constructor. | |
Neuron & | operator[] (size_t i) throw (NetworkIndexOutOfBoundsException) |
Redefinition for operator []. | |
void | link (Layer &l) |
It links a layer to another. | |
void | setInput (std::vector< double > v) |
Set the input values for the neurons of the layer (just use it for the input layer). | |
void | propagate () |
It propagates its activation values to the output layers. | |
size_t | size () const |
Private Attributes | |
std::vector< Neuron > | elements |
double | threshold |
void(* | update_weights )() |
double(* | actv_f )(double) |
Don't use this class directly unless you know what you're doing, use NeuralNet instead
neuralpp::Layer::Layer | ( | size_t | sz, | |
double(*)(double) | a, | |||
double | th = 0.0 | |||
) |
Constructor.
sz | Size of the layer | |
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::Layer::Layer | ( | std::vector< Neuron > & | neurons, | |
double(*)(double) | a, | |||
double | th = 0.0 | |||
) |
Alternative constructor.
It directly gets a vector of neurons to build the layer
neurons | Vector of neurons to be included in the layer | |
a | Activation function | |
th | Threshold, value in [0,1] that establishes how much a neuron must be 'sensitive' on variations of the input values |
Neuron& neuralpp::Layer::operator[] | ( | size_t | i | ) | throw (NetworkIndexOutOfBoundsException) |
Redefinition for operator [].
It gets the neuron at i
i | Index of the neuron to get in the layer |
void neuralpp::Layer::link | ( | Layer & | l | ) |
void neuralpp::Layer::setInput | ( | std::vector< double > | v | ) |
Set the input values for the neurons of the layer (just use it for the input layer).
v | Vector containing the input values |
void neuralpp::Layer::propagate | ( | ) |
It propagates its activation values to the output layers.
size_t neuralpp::Layer::size | ( | ) | const |
std::vector<Neuron> neuralpp::Layer::elements [private] |
double neuralpp::Layer::threshold [private] |
void(* neuralpp::Layer::update_weights)() [private] |
double(* neuralpp::Layer::actv_f)(double) [private] |