GTK+ IOStream  Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
NeuralNetwork< TYPE > Class Template Reference

#include <NeuralNetwork.H>

Public Member Functions

 NeuralNetwork (void)
 Constructor. More...
 
virtual ~NeuralNetwork (void)
 Destructor. More...
 
void activate (vector< NeuralLayer< TYPE > * > &layers, Eigen::Matrix< TYPE, Eigen::Dynamic, 1 > &input)
 

Detailed Description

template<typename TYPE>
class NeuralNetwork< TYPE >

Implements a feed forward neural network.

The network is used as follows :

// Begin constructing the neural network topology
vector<NeuralLayer<double> *> networkLayers;
networkLayers.push_back(new TanhLayer<double>(weights, bias));
networkLayers.push_back(new TanhLayer<double>(weights, bias));
// setup some input
Eigen::Matrix<double, Eigen::Dynamic, 1> input(10,1);
input<<0.8333,0.8333,0.8333,0.8333,0.8333,0.6871,0.5833,0.4371,0.3333,0.4000;
// Actiave the Neural Network
nn.activate(networkLayers, input);
// the result is in the last layer
cout<<networkLayers[networkLayers.size()-1]->output<<endl;
Template Parameters
TYPEthe precision of the data to use, e.g. float, double

Definition at line 210 of file NeuralNetwork.H.

Constructor & Destructor Documentation

template<typename TYPE>
NeuralNetwork< TYPE >::NeuralNetwork ( void  )
inline

Constructor.

Definition at line 213 of file NeuralNetwork.H.

template<typename TYPE>
virtual NeuralNetwork< TYPE >::~NeuralNetwork ( void  )
inlinevirtual

Destructor.

Definition at line 216 of file NeuralNetwork.H.

Member Function Documentation

template<typename TYPE>
void NeuralNetwork< TYPE >::activate ( vector< NeuralLayer< TYPE > * > &  layers,
Eigen::Matrix< TYPE, Eigen::Dynamic, 1 > &  input 
)
inline
Activates all layers in the neural network.

The last layer has the output

Parameters
layersVarious neural network layers, 0 being the input layer
inputThe input vector to feed forward

Definition at line 223 of file NeuralNetwork.H.

Here is the caller graph for this function:


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