GPUMLib  0.2.2
GPU Machine Learning Library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MultipleBackPropagation Class Reference

Represents a multiple feed-forward network that can be trained using the CUDA implementation of the Multiple Back-Propagation algorithm. More...

#include <MultipleBackPropagation.h>

Inheritance diagram for MultipleBackPropagation:
BackPropagation

Public Member Functions

 MultipleBackPropagation (HostArray< int > &sizeLayers, HostArray< bool > &selectiveNeurons, HostArray< int > &sizeAdditionalSpaceLayers, HostMatrix< cudafloat > &trainInputPatterns, HostMatrix< cudafloat > &trainDesiredOutputPatterns, cudafloat initialLearningRate=INITIAL_LEARNING_RATE)
 
bool HasSelectiveNeurons (int layer) const
 
int GetNumberLayersSpaceNetwork () const
 
int GetNumberNeuronsSpaceNetwork (int layer) const
 
HostArray< cudafloatGetLayerWeightsSpaceNetwork (int layer)
 
void SetLayerWeightsSpaceNetwork (int layer, HostArray< cudafloat > &weights)
 
HostArray< cudafloatGetSelectiveInputWeightsSpaceNetwork ()
 
void SetSelectiveInputWeightsSpaceNetwork (HostArray< cudafloat > &weights)
 
HostArray< cudafloatGetSelectiveInputBiasSpaceNetwork ()
 
void SetSelectiveInputBiasSpaceNetwork (HostArray< cudafloat > &bias)
 
void RandomizeWeights (cudafloat minValue, cudafloat maxValue)
 
bool GetRobustLearning () const
 
void SetRobustLearning (bool value)
 
cudafloat GetMaxPercentageRMSGrow () const
 
void SetMaxPercentageRMSGrow (cudafloat value)
 
cudafloat GetRobustFactor () const
 
void SetRobustFactor (cudafloat value)
 
cudafloat GetMomentum () const
 
void SetMomentum (cudafloat value)
 
cudafloat GetUpStepSizeFactor () const
 
void SetUpStepSizeFactor (cudafloat value)
 
cudafloat GetDownStepSizeFactor () const
 
void SetDownStepSizeFactor (cudafloat value)
 
cudafloat GetMaxStepSize () const
 
void SetMaxStepSize (cudafloat value)
 
int GetEpoch () const
 
int GetNumberLayers () const
 
int GetNumberInputs () const
 
int GetNumberOutputs () const
 
int GetNumberNeurons (int layer) const
 
cudafloat GetRMSestimate ()
 
cudafloat GetRMS ()
 
void TrainOneEpoch ()
 Trains the network one epoch.
 
void Train (int epochs)
 
void Train (int epochs, cudafloat rmsStop)
 
HostMatrix< cudafloatGetOutputs (HostMatrix< cudafloat > &inputs)
 
HostArray< cudafloatGetLayerWeights (int layer)
 
void SetLayerWeights (int layer, HostArray< cudafloat > &weights)
 
void SetLayerWeights (int layer, HostMatrix< cudafloat > &weights, HostArray< cudafloat > &bias)
 
bool HasSelectiveInputs () const
 
HostArray< cudafloatGetSelectiveInputWeights ()
 
void SetSelectiveInputWeights (HostArray< cudafloat > &weights)
 
HostArray< cudafloatGetSelectiveInputBias ()
 
void SetSelectiveInputBias (HostArray< cudafloat > &bias)
 

Protected Member Functions

void CreateNetwork (HostArray< int > &sizeLayers, HostArray< int > *sizeSpaceLayers, HostArray< bool > *selectiveNeurons, HostMatrix< cudafloat > &trainInputPatterns, HostMatrix< cudafloat > &trainDesiredOutputPatterns, cudafloat initialLearningRate)
 

Protected Attributes

HostArray< Layer > spaceLayers
 
SelectiveInputLayer * selectiveInputLayerSpaceNetwork
 

Detailed Description

Represents a multiple feed-forward network that can be trained using the CUDA implementation of the Multiple Back-Propagation algorithm.

Examples:
MBP.cpp.

Definition at line 32 of file MultipleBackPropagation.h.

Constructor & Destructor Documentation

MultipleBackPropagation ( HostArray< int > &  sizeLayers,
HostArray< bool > &  selectiveNeurons,
HostArray< int > &  sizeAdditionalSpaceLayers,
HostMatrix< cudafloat > &  trainInputPatterns,
HostMatrix< cudafloat > &  trainDesiredOutputPatterns,
cudafloat  initialLearningRate = INITIAL_LEARNING_RATE 
)

Constructs a multiple feed-forward network that can be trained using the CUDA implementation of the Multiple Back-Propagation algorithm.

Parameters
sizeLayersNumber of neurons of each layer (must include the input layer) of the main network.
selectiveNeuronsIndicates which layers have selective activation neurons. At least one layer must contain selective activation neurons.
sizeAdditionalSpaceLayersAdditional layers (besides the output layer) of the space network.
trainInputPatternsInputs of the training dataset. Each row of the matrix should contain a pattern (sample) and each column an input.
trainDesiredOutputPatternsDesired outputs for the training dataset. Each row of the matrix should contain a pattern (sample) and each column the desired values (labels) for an output.
initialLearningRateThe initial learning rate (step sizes) of the network.
Warning
You have to include the input layer in the constructor. But when calling the class methods, the first hidden layer will be 0 (zero).

Definition at line 25 of file MultipleBackPropagation.cu.

Member Function Documentation

cudafloat GetDownStepSizeFactor ( ) const
inherited

Gets the decrement (down) factor.

Returns
The decrement (down) factor.
Examples:
MBP.cpp.

Definition at line 524 of file BackPropagation.cu.

int GetEpoch ( ) const
inherited

Gets the current training epoch.

Returns
The current epoch.
Examples:
MBP.cpp.

Definition at line 542 of file BackPropagation.cu.

HostArray< cudafloat > GetLayerWeights ( int  layer)
inherited

Gets the input weights of a given layer of the network (includes the bias).

Parameters
layerthe layer.
Returns
The weights.
Examples:
MBP.cpp.

Definition at line 420 of file BackPropagation.cu.

HostArray< cudafloat > GetLayerWeightsSpaceNetwork ( int  layer)

Gets the input weights of a given layer of the space network.

Parameters
layerthe layer.
Returns
The weights.
Examples:
MBP.cpp.

Definition at line 65 of file MultipleBackPropagation.cu.

cudafloat GetMaxPercentageRMSGrow ( ) const
inherited

Gets the maximum allowable growth of the root mean square error in terms of percentage, before the robust training is applied.

Returns
the maximum growth percentage (e.g. 0.1% -> 0.001).
Examples:
MBP.cpp.

Definition at line 488 of file BackPropagation.cu.

cudafloat GetMaxStepSize ( ) const
inherited

Gets the maximum step size.

Returns
The maximum step size.
Examples:
MBP.cpp.

Definition at line 533 of file BackPropagation.cu.

cudafloat GetMomentum ( ) const
inherited

Gets the momentum.

Returns
The momentum.
Examples:
MBP.cpp.

Definition at line 506 of file BackPropagation.cu.

int GetNumberInputs ( ) const
inherited

Gets the number of inputs of the network.

Returns
The number of inputs of the network
Examples:
MBP.cpp.

Definition at line 550 of file BackPropagation.cu.

int GetNumberLayers ( ) const
inherited

Gets the number of layers (does not include the input layer).

Returns
The number of layers (not including the input layer).
Examples:
MBP.cpp.

Definition at line 546 of file BackPropagation.cu.

int GetNumberLayersSpaceNetwork ( ) const

Gets the number of layers of the space network (does not include the input layer).

Returns
The number of layers of the space network (not including the input layer).
Examples:
MBP.cpp.

Definition at line 56 of file MultipleBackPropagation.cu.

int GetNumberNeurons ( int  layer) const
inherited

Gets the number of neurons of a given layer.

Parameters
layerthe layer.
Returns
The number of neurons of the network layer.
Examples:
MBP.cpp.

Definition at line 558 of file BackPropagation.cu.

int GetNumberNeuronsSpaceNetwork ( int  layer) const

Gets the number of neurons of a given layer of the space network.

Parameters
layerthe layer.
Returns
The number of neurons of the space network layer.
Examples:
MBP.cpp.

Definition at line 60 of file MultipleBackPropagation.cu.

int GetNumberOutputs ( ) const
inherited

Gets the number of outputs of the network.

Returns
The number of outputs of the network

Definition at line 554 of file BackPropagation.cu.

HostMatrix< cudafloat > GetOutputs ( HostMatrix< cudafloat > &  inputs)
inherited

Computes the network outputs for a given set of inputs.

Parameters
inputsInputs to be presented to the network.
Returns
A matrix containing the network outputs.

Definition at line 657 of file BackPropagation.cu.

cudafloat GetRMS ( )
inherited

Gets the root mean square error of the network.

Returns
The root mean square error.
Attention
Do not use during training or it will slow down considerably the training process. Use GetRMSestimate instead.
See also
GetRMSestimate
Examples:
MBP.cpp.

Definition at line 575 of file BackPropagation.cu.

cudafloat GetRMSestimate ( )
inherited

Gets an estimate of the root mean square error of the network.

Returns
An estimate of the root mean square error.
See also
GetRMS
Examples:
MBP.cpp.

Definition at line 587 of file BackPropagation.cu.

cudafloat GetRobustFactor ( ) const
inherited

Gets the robust training (reducing/decreasing) factor.

Returns
the robust training factor.
Examples:
MBP.cpp.

Definition at line 497 of file BackPropagation.cu.

bool GetRobustLearning ( ) const
inherited

Gets whether robust the robust training is used during the training.

Returns
Whether robust training is used or not.
Examples:
MBP.cpp.

Definition at line 480 of file BackPropagation.cu.

HostArray< cudafloat > GetSelectiveInputBias ( )
inherited

Gets the selective input bias of the network.

Returns
The bias.

Definition at line 460 of file BackPropagation.cu.

HostArray< cudafloat > GetSelectiveInputBiasSpaceNetwork ( )

Gets the selective input bias of the network.

Returns
The bias.

Definition at line 83 of file MultipleBackPropagation.cu.

HostArray< cudafloat > GetSelectiveInputWeights ( )
inherited

Gets the selective input weights of the network.

Returns
The weights.

Definition at line 452 of file BackPropagation.cu.

HostArray< cudafloat > GetSelectiveInputWeightsSpaceNetwork ( )

Gets the selective input weights of the network.

Returns
The weights.

Definition at line 75 of file MultipleBackPropagation.cu.

cudafloat GetUpStepSizeFactor ( ) const
inherited

Gets the increment (up) factor.

Returns
The increase (up) factor.
Examples:
MBP.cpp.

Definition at line 515 of file BackPropagation.cu.

bool HasSelectiveInputs ( ) const
inlineinherited

Sets Indicates if the network contains selective inputs.

Returns
true if the network contains selective inputs, false otherwise

Definition at line 336 of file BackPropagation.h.

bool HasSelectiveNeurons ( int  layer) const

Indicates if a given layer has neurons with selective activation.

Returns
true if the layer has neurons with selective activation, false otherwise.
Examples:
MBP.cpp.

Definition at line 51 of file MultipleBackPropagation.cu.

void RandomizeWeights ( cudafloat  minValue,
cudafloat  maxValue 
)
inherited

Randomizes the weights of the network, between two values.

Parameters
minValueminimum value.
maxValuemaximum value

Definition at line 468 of file BackPropagation.cu.

void SetDownStepSizeFactor ( cudafloat  value)
inherited

Sets the decrement (down) factor.

Parameters
valueThe decrement (down) factor.
Examples:
MBP.cpp.

Definition at line 528 of file BackPropagation.cu.

void SetLayerWeights ( int  layer,
HostArray< cudafloat > &  weights 
)
inherited

Sets the input weights of a given layer of the network (must include the bias).

Parameters
layerthe layer.
weightsThe weights.

Definition at line 425 of file BackPropagation.cu.

void SetLayerWeights ( int  layer,
HostMatrix< cudafloat > &  weights,
HostArray< cudafloat > &  bias 
)
inherited

Sets the input weights of a given layer of the network.

Parameters
layerthe layer.
weightsThe weights.
biasThe bias.

Definition at line 430 of file BackPropagation.cu.

void SetLayerWeightsSpaceNetwork ( int  layer,
HostArray< cudafloat > &  weights 
)

Sets the input weights of a given layer of the space network.

Parameters
layerthe layer.
weightsThe weights.

Definition at line 70 of file MultipleBackPropagation.cu.

void SetMaxPercentageRMSGrow ( cudafloat  value)
inherited

Sets the maximum allowable growth of the root mean square error in terms of percentage, before the robust training is applied.

Parameters
valuethe maximum grow percentage (e.g. 0.1% -> 0.001).
Examples:
MBP.cpp.

Definition at line 492 of file BackPropagation.cu.

void SetMaxStepSize ( cudafloat  value)
inherited

Sets the maximum step size.

Parameters
valueThe maximum step size.
Examples:
MBP.cpp.

Definition at line 537 of file BackPropagation.cu.

void SetMomentum ( cudafloat  value)
inherited

Sets the momentum.

Parameters
valueThe momentum factor.
Examples:
MBP.cpp.

Definition at line 510 of file BackPropagation.cu.

void SetRobustFactor ( cudafloat  value)
inherited

Sets the robust training (reducing/decreasing) factor.

Parameters
valueRobust training factor.
Examples:
MBP.cpp.

Definition at line 501 of file BackPropagation.cu.

void SetRobustLearning ( bool  value)
inherited

Sets if robust training is used during the training.

Parameters
valuetrue if robust learning should be used. False otherwise.
Examples:
MBP.cpp.

Definition at line 484 of file BackPropagation.cu.

void SetSelectiveInputBias ( HostArray< cudafloat > &  bias)
inherited

Sets the selective input bias of the network.

Parameters
biasThe bias.

Definition at line 464 of file BackPropagation.cu.

void SetSelectiveInputBiasSpaceNetwork ( HostArray< cudafloat > &  bias)

Sets the selective input bias of the network.

Parameters
biasThe bias.

Definition at line 87 of file MultipleBackPropagation.cu.

void SetSelectiveInputWeights ( HostArray< cudafloat > &  weights)
inherited

Sets the selective input weights of the network.

Parameters
weightsThe weights.

Definition at line 456 of file BackPropagation.cu.

void SetSelectiveInputWeightsSpaceNetwork ( HostArray< cudafloat > &  weights)

Sets the selective input weights of the network.

Parameters
weightsThe weights.

Definition at line 79 of file MultipleBackPropagation.cu.

void SetUpStepSizeFactor ( cudafloat  value)
inherited

Sets the increment (up) factor.

Parameters
valueThe increment (up) factor.
Examples:
MBP.cpp.

Definition at line 519 of file BackPropagation.cu.

void Train ( int  epochs)
inherited

Trains the network for a given number of epochs.

Parameters
epochsnumber of epochs.

Definition at line 642 of file BackPropagation.cu.

void Train ( int  epochs,
cudafloat  rmsStop 
)
inherited

Trains the network for a given number of epochs or until its error is lower or equal than a specified RMS error.

Parameters
epochsnumber of epochs.
rmsStopdesired RMS error.

Definition at line 646 of file BackPropagation.cu.


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