LoveBrains
1.0.0
|
Define a layer of a neural network. More...
#include <ann_layer.h>
Public Types | |
typedef double(* | FActivate) (double) |
Function pointer of an activation function. | |
typedef double(* | FActivate) (double) |
Public Member Functions | |
ANNLayer (unsigned int num_inputs, unsigned int num_neurons, double min, double max, FActivate activation) | |
Constructor. More... | |
ANNLayer (ANNLayer const ©) | |
Constructor. More... | |
ANNLayer (void) | |
Constructor. | |
~ANNLayer (void) | |
Destructor. | |
Matrix< double > const & | getWeights (void) const |
Get the weights matrix of the neural network. More... | |
Matrix< double > & | getWeights (void) |
Get the weights matrix of the neural network. More... | |
Matrix< double > const & | getOutputs (void) const |
Get the outputs matrix of the neural network. GANN::Matrix<double> const&. | |
Matrix< double > const & | getBias (void) const |
Get the bias matrix of the neural network. More... | |
Matrix< double > & | getBias (void) |
Get the bias matrix of the neural network. More... | |
FActivate | getActivationFunction (void) const |
Get the activation function of the current layer. More... | |
void | setWeights (Matrix< double > const &weights) |
Set the matrix of weights. More... | |
void | setBias (Matrix< double > const &bias) |
Set the matrix of bias. More... | |
void | setOutputs (Matrix< double > const &outputs) |
Set the outputs matrix. More... | |
void | setActivationFunction (FActivate f) |
Set the activation function of the layer. More... | |
ANNLayer & | operator= (ANNLayer const &layer) |
void | Activate (Matrix< double > const &inputs) |
Activate the current layer and set the matrix of outputs. More... | |
ANNLayer (unsigned int num_inputs, unsigned int num_neurons, double min, double max, FActivate activation) | |
ANNLayer (ANNLayer const ©) | |
Matrix< double > const & | getWeights (void) const |
Matrix< double > & | getWeights (void) |
Matrix< double > const & | getOutputs (void) const |
Matrix< double > const & | getBias (void) const |
Matrix< double > & | getBias (void) |
FActivate | getActivationFunction (void) const |
void | setWeights (Matrix< double > const &weights) |
void | setBias (Matrix< double > const &bias) |
void | setOutputs (Matrix< double > const &outputs) |
void | setActivationFunction (FActivate f) |
ANNLayer & | operator= (ANNLayer const &layer) |
void | Activate (Matrix< double > const &inputs) |
Define a layer of a neural network.
GANN::ANNLayer::ANNLayer | ( | unsigned int | num_inputs, |
unsigned int | num_neurons, | ||
double | min, | ||
double | max, | ||
FActivate | activation | ||
) |
Constructor.
num_inputs | : Contains the number of inputs. |
num_neurons | : Contains the number of neurons in the layer. |
min | : Contains the minimum value of the randomization. |
max | : Contains the maximum value of the randomization. |
activation | : Contains the function pointer of the activation function. |
GANN::ANNLayer::ANNLayer | ( | ANNLayer const & | copy | ) |
Constructor.
copy | : Contains a layer that will be used in order to create a new layer. |
void GANN::ANNLayer::Activate | ( | Matrix< double > const & | inputs | ) |
Activate the current layer and set the matrix of outputs.
inputs | : Contains the matrix of inputs of the layer. |
ANNLayer::FActivate GANN::ANNLayer::getActivationFunction | ( | void | ) | const |
Get the activation function of the current layer.
Matrix< double > const & GANN::ANNLayer::getBias | ( | void | ) | const |
Get the bias matrix of the neural network.
Matrix< double > & GANN::ANNLayer::getBias | ( | void | ) |
Get the bias matrix of the neural network.
Matrix< double > const & GANN::ANNLayer::getWeights | ( | void | ) | const |
Get the weights matrix of the neural network.
Matrix< double > & GANN::ANNLayer::getWeights | ( | void | ) |
Get the weights matrix of the neural network.
void GANN::ANNLayer::setActivationFunction | ( | FActivate | f | ) |
Set the activation function of the layer.
f | : Contains the function pointer of the activation function. |
void GANN::ANNLayer::setBias | ( | Matrix< double > const & | bias | ) |
Set the matrix of bias.
bias | : Contains the matrix of bias. |
void GANN::ANNLayer::setOutputs | ( | Matrix< double > const & | outputs | ) |
Set the outputs matrix.
outputs | : Contains the matrix of outputs.x |
void GANN::ANNLayer::setWeights | ( | Matrix< double > const & | weights | ) |
Set the matrix of weights.
weights | : Contains the matrix of weights. |