LoveBrains  1.0.0
Public Types | Public Member Functions | List of all members
GANN::ANNLayer Class Reference

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 &copy)
 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...
 
ANNLayeroperator= (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 &copy)
 
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)
 
ANNLayeroperator= (ANNLayer const &layer)
 
void Activate (Matrix< double > const &inputs)
 

Detailed Description

Define a layer of a neural network.

Constructor & Destructor Documentation

GANN::ANNLayer::ANNLayer ( unsigned int  num_inputs,
unsigned int  num_neurons,
double  min,
double  max,
FActivate  activation 
)

Constructor.

Parameters
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.

Parameters
copy: Contains a layer that will be used in order to create a new layer.

Member Function Documentation

void GANN::ANNLayer::Activate ( Matrix< double > const &  inputs)

Activate the current layer and set the matrix of outputs.

Parameters
inputs: Contains the matrix of inputs of the layer.
ANNLayer::FActivate GANN::ANNLayer::getActivationFunction ( void  ) const

Get the activation function of the current layer.

Returns
GANN::ANNLayer::FActivate
Matrix< double > const & GANN::ANNLayer::getBias ( void  ) const

Get the bias matrix of the neural network.

Returns
GANN::Matrix<double> const&
Matrix< double > & GANN::ANNLayer::getBias ( void  )

Get the bias matrix of the neural network.

Returns
GANN::Matrix<double> &
Matrix< double > const & GANN::ANNLayer::getWeights ( void  ) const

Get the weights matrix of the neural network.

Returns
GANN::Matrix<double> const&
Matrix< double > & GANN::ANNLayer::getWeights ( void  )

Get the weights matrix of the neural network.

Returns
GANN::Matrix<double> &
void GANN::ANNLayer::setActivationFunction ( FActivate  f)

Set the activation function of the layer.

Parameters
f: Contains the function pointer of the activation function.
void GANN::ANNLayer::setBias ( Matrix< double > const &  bias)

Set the matrix of bias.

Parameters
bias: Contains the matrix of bias.
void GANN::ANNLayer::setOutputs ( Matrix< double > const &  outputs)

Set the outputs matrix.

Parameters
outputs: Contains the matrix of outputs.x
void GANN::ANNLayer::setWeights ( Matrix< double > const &  weights)

Set the matrix of weights.

Parameters
weights: Contains the matrix of weights.

The documentation for this class was generated from the following files: