DeepCL  SNAPSHOT
Deep convolutional neural networks using OpenCL
Public Member Functions | List of all members
NeuralNet Class Reference

NeuralNet: main container class for network layers. More...

Inherits Trainable.

Public Member Functions

 NeuralNet (EasyCL *cl, int numPlanes, int imageSize)
 Constructor.
 
publicapi void addLayer (LayerMaker2 *maker)
 Add a network layer, using a LayerMaker2 object. More...
 
publicapi void initWeights (int layerIndex, float *weights, float *bias)
 
publicapi void initWeights (int layerIndex, float *weights)
 
publicapi void initBias (int layerIndex, float *weights)
 
publicapi float calcLoss (float const *expectedValues)
 calculate the loss, based on the passed in expectedValues array More...
 
publicapi float calcLossFromLabels (int const *labels)
 
publicapi InputLayer * getFirstLayer ()
 
publicapi LayergetLastLayer ()
 
publicapi int getNumLayers () const
 
publicapi LayergetLayer (int index)
 
publicapi Layer const * getLastLayer () const
 
virtual publicapi int getOutputPlanes () const
 
virtual publicapi int getOutputSize () const
 
publicapi void setBatchSize (int batchSize)
 
publicapi void setTraining (bool training)
 
publicapi int calcNumRight (int const *labels)
 
publicapi void forward (float const *images)
 
publicapi void backwardFromLabels (int const *labels)
 note: this does no learning, just calculates the gradients More...
 
publicapi void backward (float const *expectedOutput)
 note: this does no learning, just calculates the gradients More...
 
publicapi int getNumLayers ()
 
publicapi float const * getOutput (int layer) const
 
publicapi int getInputCubeSize () const
 
publicapi int getOutputCubeSize () const
 
publicapi float const * getOutput () const
 
virtual publicapi int getOutputNumElements () const
 
publicapi std::string asString ()
 
publicapi const char * asNewCharStar ()
 

Detailed Description

NeuralNet: main container class for network layers.

Public API

Member Function Documentation

publicapi void NeuralNet::addLayer ( LayerMaker2 *  maker)

Add a network layer, using a LayerMaker2 object.

Public API
publicapi void NeuralNet::initWeights ( int  layerIndex,
float *  weights,
float *  bias 
)
Public API
publicapi void NeuralNet::initWeights ( int  layerIndex,
float *  weights 
)
Public API
publicapi void NeuralNet::initBias ( int  layerIndex,
float *  weights 
)
Public API
publicapi float NeuralNet::calcLoss ( float const *  expectedValues)

calculate the loss, based on the passed in expectedValues array

Public API
Public API

Calculate the loss, based on the passed in expectedValues array which should be the same size as the output of the final layer of the network

Public API
publicapi float NeuralNet::calcLossFromLabels ( int const *  labels)
Public API
publicapi InputLayer * NeuralNet::getFirstLayer ( )
Public API
publicapi Layer * NeuralNet::getLastLayer ( )
Public API
publicapi int NeuralNet::getNumLayers ( ) const
Public API
publicapi Layer * NeuralNet::getLayer ( int  index)
Public API
publicapi Layer const * NeuralNet::getLastLayer ( ) const
Public API
publicapi VIRTUAL int NeuralNet::getOutputPlanes ( ) const
virtual
Public API
publicapi VIRTUAL int NeuralNet::getOutputSize ( ) const
virtual
Public API
publicapi void NeuralNet::setBatchSize ( int  batchSize)
Public API
publicapi void NeuralNet::setTraining ( bool  training)
Public API
publicapi int NeuralNet::calcNumRight ( int const *  labels)
Public API
publicapi void NeuralNet::forward ( float const *  images)
Public API
publicapi void NeuralNet::backwardFromLabels ( int const *  labels)

note: this does no learning, just calculates the gradients

Public API
publicapi void NeuralNet::backward ( float const *  expectedOutput)

note: this does no learning, just calculates the gradients

Public API
publicapi int NeuralNet::getNumLayers ( )
Public API
publicapi float const * NeuralNet::getOutput ( int  layer) const
Public API
publicapi int NeuralNet::getInputCubeSize ( ) const
Public API
publicapi int NeuralNet::getOutputCubeSize ( ) const
Public API
publicapi float const * NeuralNet::getOutput ( ) const
Public API
publicapi VIRTUAL int NeuralNet::getOutputNumElements ( ) const
virtual
Public API
publicapi std::string NeuralNet::asString ( )
Public API
publicapi const char * NeuralNet::asNewCharStar ( )
Public API

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