| IGLib 1.7.2 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Private Attributes | List of all members
IG.Num.NeuralApproximatorAforgeIT Class Reference

Approximator of response by using neural networks, based on the AforgeDotNet library. $A Igor Mar11; More...

Inheritance diagram for IG.Num.NeuralApproximatorAforgeIT:
[legend]
Collaboration diagram for IG.Num.NeuralApproximatorAforgeIT:
[legend]

## Public Member Functions
| NeuralApproximatorAforgeIT ()
override void | PrepareNetwork ()
| Prepares neural network for use. If networks have not yet been created accordinfg to internal data, they are created. If networks are already prepared then this method does nothing. More...
override void | CreateNetwork ()
| Creates the neural network anew. It the network already exists on the current object, it is discarded. More...
override void | ResetNetwork ()
| Resets the neural network(s), clears information generated during training. More...
override void | DestroyNetwork ()
| Destroys the neural network. More...
override void | CalculateOutput (IVector input, ref IVector output)
| Calculates and returns the approximated output values corresponding to the specified inputs, by using the current neural network(s). More...
Public Member Functions inherited from IG.Num.NeuralApproximatorBase
| NeuralApproximatorBase ()
virtual int | GetNumNeuronsInHiddenLayer (int whichLayer)
| Returns the number of neurons in the specified hidden layer. Hidden layers are those not containing input or output neurons. More...
virtual void | SetNumNeuronsInHiddenLayer (int whichLayer, int numNeurons)
| Sets the number of neurons in the specified hidden layer. Hidden layers are those not containing input or output neurons. More...
virtual void | SetHiddenLayers (params int[] numNeurons)
| Sets the numbers of neurons in each hidden layer. Can be called with table of integers as argument, kor with variable number of integer parameters. Numbers are set by an array of integers in which each element contains the number of neurons in the corresponding hidden layer (indexed from 0). Hidden layers are those not containing input or output neurons. More...
string | GetNetworkFilePath (string fileOrDirectoryPath, int whichNetwork)
| Returns an absolute path to the file for storing the specified neural network contained on the current object, with respect to suggested file path and index of the network. The returned path is in the same directory as suggested file path and has the same file extension (if any). If the suggested path represents a directory, then some default suggested path is assumed. If there is only one network then the returned file path is the same as the suggested one (or the same as default file name within the suggested directory, if a directory path is proposed). More...
void | SaveNetwork (string filePath)
| Saves the state of the neural network to the specified file. If the file already exists, its contents are overwritten. More...
void | LoadNetwork (string filePath)
| Restores neural network from a file where it has been stored before. More...
void | SetTrainingAndVerificationData (SampledDataSet trainingData, SampledDataSet verificationData)
void | GetTrainingData (ref SampledDataSet trainingData)
void | GetVerificationData (ref SampledDataSet veerificationData)
void | GetTrainingAndVerificationData (ref SampledDataSet trainingData, ref SampledDataSet verificationData)
void | SaveTrainingDataJson (string filePath)
| Saves network's training data to the specified JSON file. File is owerwritten if it exists. More...
void | LoadTrainingDataJson (string filePath)
| Restores training data from the specified file in JSON format. More...
void | SetNeuronsInputRange (double min, double max)
| Sets the neurons input range. Bounds for all input neurons are set equally. More...
void | SetNeuronsOutputRange (double min, double max)
| Sets the neurons output range. Bounds for all output neurons are set equally. More...
void | RecalculateInputDataBounds ()
| Recalculates input data bounds by taking into account the training data set of the current object. More...
void | RecalculateOutputDataBounds ()
| Recalculates output data bounds by taking into account the training data set of the current object. More...
void | RecalculateDataBounds ()
| Recalculates input and output data bounds by taking into account the training data set of the current object. More...
void | RecalculateInputDataBounds (SampledDataSet trainingData)
| Recalculates input data bounds by taking into account the specified training data set. More...
void | RecalculateOutputDataBounds (SampledDataSet trainingData)
| Recalculates output data bounds by taking into account the specified training data set. More...
void | RecalculateDataBounds (SampledDataSet trainingData)
| Recalculates input and output data bounds by taking into account the specified training data set. More...
void | GetErrorsTrainingRms (ref IVector errors)
| Calculates the RMS (root mean square) of the errors of output values for the training elements of the training set (this excludes verification points). More...
void | GetErrorsVerificationRms (ref IVector errors)
| Calculates the RMS (root mean square) of the errors of output values for the verification elements of the training set. More...
void | GetErrorsTrainingMax (ref IVector errors)
| Calculates the maximum absolute errors of output values for the training elements of the training set (this excludes verification points). More...
void | GetErrorsVerificationMax (ref IVector errors)
| Calculates the maximum absolute errors of output values for the verification elements of the training set. More...
void | GetErrorsTrainingMeanAbs (ref IVector errors)
| Calculates the mean absolute errors of output values for the training elements of the training set (this excludes verification points). More...
void | GetErrorsVerificationMeanAbs (ref IVector errors)
| Calculates the mean absolute errors of output values for the verification elements of the training set. More...
virtual void | InvalidateTrainingDependencies ()
| Invalidates all data that must be recalculated after training of the network is done. This method is called after training or additional training of the network is performed. Invalidation is achieved throughthe the appropriate flags. More...
virtual void | InvalidateTrainingDataDependencies ()
| Invalidates all data that must be re-calculated after training data changes. This method is called after training data is modified. Invalidation is achieved throughthe the appropriate flags. More...
virtual void | InvalidateNetworkDependencies ()
| Invalidates all data that must be re-calculated after the neural network itself changes. This method must be called after the internal neural network is re-defined (or are re-defined). Invalidation is achieved throughthe the appropriate flags. More...
void | TrainNetwork (int numEpochs)
| Trains neural network wiht the specified data, performing the specified number of epochs. More...
void | TrainNetworkMultiple (int numEpochs, int numIterations)
| Performs a specified number of training iterations where the specified number of epochs are run in each iteration. More...
void | TrainNetworkMultiple (int numIterations)
| Performs a specified number of training iterations where the prescribed number of epochs (contained in the EpochsInBundle property) are run in each iteration. More...
virtual void | TrainNetwork ()
| Trains neural network until stopping criteria are met (in terms of errors and number of epochs performed. More...
virtual bool | StopTrainingCriteriaMet ()
| Returns true if the stopping criteria for training is met, with respect to current settings, errors and number of epochs already performed, and false otherwise. More...
override double | CalculateOutput (IVector input, int whichElement)
| Calculates and returns the specified output by using the neural network. More...
override void | CalculateOutput (IVector input, int[] indices, ref IVector filteredOutput)
| Calculates and returns the required output values corresponding to the specified inputs, by using the current neural network(s). More...
override string | ToString ()
| Returns string describing the current neural network approximator. More...
void | SaveTrainingDataJson_To_delete (string filePath)
| Saves network's training data to the specified JSON file. File is owerwritten if it exists. More...
void | LoadTrainingDataJson_To_Delete (string filePath)
| Restores training data from the specified file in JSON format. More...
void | TestMapping ()
| Test back and forth mapping (scaling and shifting) from actual data to data prepared for training, and vice versa (checks if transformed data falls withi the prescribed ranges and if backward transformation yields the same result as forward transformation). Testing is performed on all data from the TrainingData property, including verification elements. More...

## Protected Member Functions
override void | PrepareNetworksArray ()
| Prepares the networks array (allocates it if necessary) for storing all neural networks of the current object. More...
virtual IActivationFunction | CreateActivationFunction ()
override void | SaveNetworkSpecific (string fileOrDirectoryPath)
| Saves the state of the neural network to the specified file. If the file already exists, its contents are overwritten. More...
override void | LoadNetworkSpecific (string fileOrDirectoryPath)
| Restores neural network from a file where it has been stored before. More...
double[][] | GetSingleNetworkTrainingOutput (int whichNetwork)
| Prepares and returns outputs for the specific network in the case with multiple networks. More...
override void | PrepareInternalTrainingData ()
| Prepares internal training data that is needed by the native training algorithm. More...
override void | TrainNetworkSpecific (int numEpochs)
| Trains neural network wiht the specified data, performing the specified number of epochs. The maximal number of epochs that is set on the current object does not have any effect in this method, and the method can perform more epochs tha specified by that limit. More...
Protected Member Functions inherited from IG.Num.NeuralApproximatorBase
void | SetRmsToleranceRelstiveToRange ()
| Updates the tolerances on RMS errors of outputs according to the relative tolerances (defined by ToleranceRmsRelativeToRange) and the ranges in output data (defined by OutputDataBounds), if both are defined. More...
void | SetMaxToleranceRelstiveToRange ()
| Updates the tolerances on max. abs. errors of outputs according to the relative tolerances (defined by ToleranceMaxRelativeToRange) and the ranges in output data (defined by OutputDataBounds), if both are defined. More...
virtual double | MapInput (int componentIndex, double value)
| Maps (scales and shifts) and returns specific input value to the value prepared for the corresponding input neuron. More...
virtual double | MapFromNeuralInput (int componentIndex, double value)
| Inverse maps (scales and shifts) and returns specific input value back from the neural input to the actual input. More...
virtual void | MapInput (IVector values, ref IVector mappedValues)
| Maps (scales and shifts) vector of input values to the vector of neuron inputs. More...
virtual void | MapFromNeuralInput (IVector values, ref IVector mappedValues)
| Inverse maps (scales and shifts) vector of neural input values back to the vector of actual inputs. More...
virtual double | MapOutput (int componentIndex, double value)
| Maps (scales and shifts) and returns specific output value to the output value of the corresponding output neuron. More...
virtual double | MapFromNeuralOutput (int componentIndex, double value)
| Inverse maps (scales and shifts) and returns specific output value back from the neural output to the actual output. More...
virtual void | MapOutput (IVector values, ref IVector mappedValues)
| Maps (scales and shifts) vector of output values to the vector of neuron outputs. More...
virtual void | MapFromNeuralOutput (IVector values, ref IVector mappedValues)
| Inverse maps (scales and shifts) vector of neural output values back to the vector of actual outputs. More...
void | CalculateTrainingVerificationOutputs (bool calculateTrainingOutputs, bool calculateVerificationOutputs)
| Calculates outputs in training points contained in training set, either in training points, in verification points, or both. More...
void | CalculateTrainingOutputs ()
| Calculates outputs in training points of the training data set (this excludes verification points). More...
void | CalculateVerificationOutputs ()
| Calculates outputs in verification points of the training data set. More...
virtual void | PrepareErrorData (ref int dimOutput, ref IVector[] prescribed, ref IVector[] calculated, bool takeTrainingPoints, bool takeVerificationPoints)
| Prepares data for calculation of various error measures over training points or in verification points after training of the neural network(s). More...

## Protected Attributes
ActivationNetwork[] | _networks
| Network(s) used for approximation. More...
BackPropagationLearning[] | _teachers
| Teachers used for network training. More...
Protected Attributes inherited from IG.Num.NeuralApproximatorBase
const string | _defaultNetworkFilename = "network.dat"
double | _defaultNeuronMinInput = -2
double | _defaultNeuronMaxInput = 2
double | _defaultNeuronMinOutput = -1.0
double | _defaultNeuronMaxOutput = 1.0
List< IVector > | _calculatedOutputs = null
| List of calculated outputs in points contained in (all) training data. More...
bool | _calculateVerificationErrors = false
Vector | _auxErrors = null
Protected Attributes inherited from IG.Num.VectorApproximatorBase
IVector | _lastCalculationInputParameters

## Properties
double[][] | TrainingInputsAForge`[get, private set]`
| Gets or sets training inputs. More...
double[][] | TrainingOutputsAForge`[get, set]`
| Gets or sets training outputs. More...
Properties inherited from IG.Num.NeuralApproximatorBase
int | OutputLevel`[get, set]`
| Level of output printed to console when performing actions. More...
virtual bool | MultipleNetworks`[get, set]`
| Flag indicating whether multiple neural networks are used to approximate multiple outputs (one network for each output) More...
override int | InputLength`[get, set]`
| Gets or sets the number of input neurons. More...
override int | OutputLength`[get, set]`
| Gets or sets the number of output neurons. More...
virtual int[] | NumHiddenNeurons`[get, set]`
| Gets or sets the numbers of neurons in each hidden layer. When setting, contents of array are copied, not only a reference. Numbers are set by an array of integers in which each element contains the number of neurons in the corresponding hidden layer (indexed from 0). Hidden layers are those not containing input or output neurons. More...
virtual int | NumHiddenLayers`[get, set]`
| Gets or sets the number of hidden layers of the neural network (these are layers that don't contain input or output neurons). More...
bool | NetworkPrepared`[get, protected set]`
| Gets a flag telling whether the network is prepared for operation (training and calculation of output). More...
double | SigmoidAlphaValue`[get, set]`
| Alpha value specifying the shape of the activation function. More...
double | LearningRate`[get, set]`
| Gets or sets learning rate. More...
double | Momentum`[get, set]`
| Gets or sets momentum. More...
int | EpochCount`[get, protected set]`
| Number of learning epochs performed up to the current moment. More...
int | MaxEpochs`[get, set]`
| Maximal number of epochs in training. More...
int | EpochsInBundle`[get, set]`
| Number of epochs in a single training bundle. This number of epochs is performed at once when training, without checking convergence criteria between. Larger value means slightly more efficient training (because of less checks) but rougher criteria checks. More...
IVector | ToleranceRms`[get, set]`
| Tolerances on RMS errors of outputs over training points. Training will continue until error becomes below tolerance or until maximal number of epochs is reached. If less or equal than 0 then this tolerance is not taken into account. More...
IVector | ToleranceMax`[get, set]`
| Tolerances on maximal errors of outputs over training points. Training will continue until error becomes below tolerance or until maximal number of epochs is reached. If less or equal than 0 then this tolerance is not taken into account. More...
IVector | ToleranceRmsRelativeToRange`[get, set]`
| Relative tolerances on RMS errors of outputs over training points, relative to the correspoinding ranges of output data. More...
double | ToleranceRmsRelativeToRangeScalar`[get, set]`
| Scalar through which all components of the Relative tolerances on RMS errors of outputs can be set to the same value. More...
IVector | ToleranceMaxRelativeToRange`[get, set]`
| Relative tolerances on max. abs. errors of outputs over training points, relative to the correspoinding ranges of output data. More...
double | ToleranceMaxRelativeToRangeScalar`[get, set]`
| Scalar through which all components of the Relative tolerances on max. abs. errors of outputs can be set to the same value. More...
List< int > | EpochNumbers`[get, set]`
| List of epoch numbers at which convergence data was sampled. Saved after every set of epochs. More...
List< IVector > | ConvergenceErrorsTrainingRmsList`[get, set]`
| Convergence List of RMS errors calculated on training data. Saved after every set of epochs. More...
List< IVector > | ConvergenceErrorsTrainingMaxList`[get, set]`
| Convergence List of Maximum errors calculated on training data. Saved after every set of epochs. More...
List< IVector > | ConvergenceErrorsVerificationRmsList`[get, set]`
| Convergence List of Rms errors calculated on verification data. Saved after every set of epochs. More...
List< IVector > | ConvergenceErrorsVerificationMaxList`[get, set]`
| Convergence List of Maximum errors calculated on verification data. Saved after every set of epochs. More...
bool | SaveConvergenceRms`[get, set]`
| Flag to enable RMS error convergence colection. More...
string | NeuralApproximatorType`[get]`
| Gets string representation of type of the current object. This is used e.g. in deserialization in order to prevent that wrong type of internal representation would be read in. More...
string | NetworkStateFilePath`[get, set]`
| Path where the curren network state has been saved, or null if the current state has not been saved yet. The SaveFile methods takes care that the file path is stored when network state is saved. InvalidateTrainingDependencies() takes care that this file path is set to null if network state has changed after last save. More...
string | NetworkStateRelativePath`[get, set]`
| Relative path where the curren network state has been saved. Auxiliary property used in deserialization. When the whole Neural network approximator is saved to a file, tis path is updated in such a way that it points to the fiele where the network state has been saved, but relative to the path where the whole approximator is saved. This enables restore of the saved network state at a later time, even if the containing directory has moved within the file system or has even been copied to another system. More...
SampledDataSet | TrainingData`[get, set]`
| Gets or sets the training data. More...
virtual IndexList | VerificationIndices`[get, set]`
| Gets or sets indices of training data elements that are used for verification of how precise appeoximation is. These elements are excluded from training of neural network. More...
virtual IBoundingBox | InputDataBounds`[get, set]`
| Bounds on input data, used for scaling from actual input to input used by neural network. Scaling is performed because of the bound codomain and image of activation functions. More...
virtual IBoundingBox | OutputDataBounds`[get, set]`
| Bounds on output data, used for scaling from actual output to output produced by neural network. Scaling is performed because of the bound codomain and image of activation functions. More...
virtual double | InputBoundsSafetyFactor`[get, set]`
| Safety factor by which interval lenghts of input data bounds are enlarged after bounds are automatically determined from the range of input data in the training set. Setter re-calculated the input data bounds and therefore invalidates training data dependencies. More...
virtual double | OutputBoundsSafetyFactor`[get, set]`
| Safety factor by which interval lenghts of output data bounds are enlarged after bounds are automatically determined from the range of output data in the training set. Setter re-calculated the output data bounds and therefore invalidates training data dependencies. More...
virtual IBoundingBox | InputNeuronsRange`[get, protected set]`
| Gets the range in which data should be for input neurons, used for scaling from actual input to input used by neural network. This depends on the activation function. More...
virtual IBoundingBox | OutputNeuronsRange`[get, protected set]`
| Gets the range of the data output from output neurons, used for scaling from actual output to output produced by neural network. This will normally depend on the activation function. More...
int | NumAllTrainingPoints`[get]`
| Gets number of all training points, including verification points. More...
virtual int | NumTrainingPoints`[get]`
| Gets number of training points (this excludes verification points). More...
virtual int | NumVerificationPoints`[get]`
| Gets number of verification points. More...
bool | TrainingOutputsCalculated`[get, set]`
| Whether outputs have been calculated, after last training, in the training points (excluding verification points). More...
bool | VerificationOutputsCalculated`[get, set]`
| Whether outputs have been calculated, after last training, in the training points (excluding verification points). More...
bool | InternalTrainingDataPrepared`[get, set]`
| Gets or sets a flag indicating whether internal training data is prepared. This flag is used internally for signalization between methods that deal with training data. More...
bool | NetworkTrained`[get, protected set]`
| Whether network has been trained since the training data was set. More...
bool | BreakTraining`[get, set]`
| Flags that signalizes (if true) that training should be broken on external request. More...
bool | CalculateVerificationErrors`[get, set]`
Properties inherited from IG.Num.VectorApproximatorBase
object | Lock`[get]`
| This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More...
abstract int | InputLength`[get, set]`
| Gets or sets the number of input parameters. More...
abstract int | OutputLength`[get, set]`
| Gets or sets the number of output values. More...
Properties inherited from IG.Lib.ILockable
object | Lock`[get]`
Properties inherited from IG.Num.INeuralApproximator
int | OutputLevel`[get, set]`
| Level of output printed to console when performing actions. More...
bool | MultipleNetworks`[get, set]`
| Flag indicating whether multiple neural networks are used to approximate multiple outputs (one network for each output) More...
int[] | NumHiddenNeurons`[get, set]`
| Sets the numbers of neurons in each hidden layer. Numbers are set by an array of integers in which each element contains the number of neurons in the corresponding hidden layer (indexed from 0). Hidden layers are those not containing input or output neurons. More...
int | NumHiddenLayers`[get, set]`
| Gets or sets the number of hidden layers of the neural network (these are layers that don't contain input or output neurons). More...
bool | NetworkPrepared`[get]`
| Gets a flag telling whether the network is prepared for operation (training and calculation of output). More...
double | SigmoidAlphaValue`[get, set]`
| Alpha value specifying the shape of the activation function. More...
double | LearningRate`[get, set]`
| Gets or sets learning rate. More...
double | Momentum`[get, set]`
| Gets or sets momentum. More...
int | EpochCount`[get]`
| Number of learning epochs performed up to the current moment. More...
int | MaxEpochs`[get, set]`
| Maximal number of epochs in training. More...
int | EpochsInBundle`[get, set]`
| Number of epochs in a single training bundle. This number of epochs is performed at once when training, without checking convergence criteria between. Larger value means slightly more efficient training (because of less checks) but rougher criteria checks. More...
IVector | ToleranceRms`[get, set]`
| Tolerance over RMS error of output over training points. Training will continue until error becomes below tolerance or until maximal number of epochs is reached. If less or equal than 0 then this tolerance is not taken into account. More...
IVector | ToleranceMax`[get, set]`
| Tolerance on maximal error of output over training points. Training will continue until error becomes below tolerance or until maximal number of epochs is reached. If less or equal than 0 then this tolerance is not taken into account. More...
IVector | ToleranceRmsRelativeToRange`[get, set]`
| Relative tolerances on RMS errors of outputs over training points, relative to the correspoinding ranges of output data. More...
double | ToleranceRmsRelativeToRangeScalar`[get, set]`
| Scalar through which all components of the Relative tolerances on RMS errors of outputs can be set to the same value. More...
IVector | ToleranceMaxRelativeToRange`[get, set]`
| Relative tolerances on max. abs. errors of outputs over training points, relative to the correspoinding ranges of output data. More...
double | ToleranceMaxRelativeToRangeScalar`[get, set]`
| Scalar through which all components of the Relative tolerances on max. abs. errors of outputs can be set to the same value. More...
bool | SaveConvergenceRms`[get, set]`
| Flag to enable Rms error convergence colection. Default is false. More...
List< int > | EpochNumbers`[get, set]`
| List of epoch numbers at which convergence data was sampled. Saved after every set of epochs. More...
List< IVector > | ConvergenceErrorsTrainingRmsList`[get, set]`
| Convergence List of Rms errors calculated on training data. Saved after every set of epochs. More...
List< IVector > | ConvergenceErrorsTrainingMaxList`[get, set]`
| Convergence List of Maximum errors calculated on training data. Saved after every set of epochs. More...
List< IVector > | ConvergenceErrorsVerificationRmsList`[get, set]`
| Convergence List of Rms errors calculated on verification data. Saved after every set of epochs. More...
List< IVector > | ConvergenceErrorsVerificationMaxList`[get, set]`
| Convergence List of Maximum errors calculated on verification data. Saved after every set of epochs. More...
string | NeuralApproximatorType`[get]`
| Gets string representation of type of the current object. This is used e.g. in deserialization in order to prevent that wrong type of internal representation would be read in. More...
string | NetworkStateFilePath`[get]`
| Path where the curren network state has been saved, or null if the current state has not been saved yet. The SaveFile methods takes care that the file path is stored when network state is saved. InvalidateTrainingDependencies() takes care that this file path is set to null if network state has changed after last save. More...
string | NetworkStateRelativePath`[get, set]`
| Relative path where the curren network state has been saved. Auxiliary property used in deserialization. When the whole Neural network approximator is saved to a file, tis path is updated in such a way that it points to the fiele where the network state has been saved, but relative to the path where the whole approximator is saved. This enables restore of the saved network state at a later time, even if the containing directory has moved within the file system or has even been copied to another system. More...
SampledDataSet | TrainingData`[get, set]`
| Gets or sets the training data. More...
IndexList | VerificationIndices`[get, set]`
| Gets or sets indices of training data elements that are used for verification of how precise appeoximation is. These elements are excluded from training of neural network. More...
IBoundingBox | InputDataBounds`[get, set]`
| Bounds on input data, used for scaling from actual input to input used by neural network. Scaling is performed because of the bound codomain and image of activation functions. More...
IBoundingBox | OutputDataBounds`[get, set]`
| Bounds on output data, used for scaling from actual output to output produced by neural network. Scaling is performed because of the bound codomain and image of activation functions. More...
double | InputBoundsSafetyFactor`[get, set]`
| Safety factor by which interval lenghts of input data bounds are enlarged after bounds are automatically determined from the range of input data in the training set. Setter re-calculated the input data bounds and therefore invalidates training data dependencies. More...
double | OutputBoundsSafetyFactor`[get, set]`
| Safety factor by which interval lenghts of output data bounds are enlarged after bounds are automatically determined from the range of output data in the training set. Setter re-calculated the output data bounds and therefore invalidates training data dependencies. More...
IBoundingBox | InputNeuronsRange`[get]`
| Gets the range in which data should be for input neurons, used for scaling from actual input to input used by neural network. This depends on the activation function. More...
IBoundingBox | OutputNeuronsRange`[get]`
| Gets the range of the data output from output neurons, used for scaling from actual output to output produced by neural network. This will normally depend on the activation function. More...
int | NumAllTrainingPoints`[get]`
| Gets number of all training points, including verification points. More...
int | NumTrainingPoints`[get]`
| Gets number of training points (this excludes verification points). More...
int | NumVerificationPoints`[get]`
| Gets number of verification points. More...
bool | NetworkTrained`[get]`
| Whether network has been trained since the training data was set. More...
bool | BreakTraining`[get, set]`
| Flags that signalizes (if true) that training should be broken on external request. More...
Properties inherited from IG.Num.IVectorApproximator
int | InputLength`[get, set]`
| Gets or sets the number of input parameters. More...
int | OutputLength`[get, set]`
| Gets or sets the number of output values. More...

## Private Attributes
double[][] | _trainingInputsAForge
double[][] | _trainingOutputsAForge
double[][] | _singleNetworkOutputs = null

## Additional Inherited Members
Static Public Member Functions inherited from IG.Num.NeuralApproximatorBase
static void | CalculateErrorsRms (int dimOutput, IVector[] prescribed, IVector[] calculated, ref IVector errors)
| Calculates error measures - RMS (root mean square) of the differences - for the specified arrays of prescribed and calculated output values in a set of sampling points. More...
static void | CalculateErrorsMeanAbs (int dimOutput, IVector[] prescribed, IVector[] calculated, ref IVector errors)
| Calculates error measures - mean absolute value of the differences - for the specified arrays of prescribed and calculated output values in a set of sampling points. More...
static void | CalculateErrorsMax (int dimOutput, IVector[] prescribed, IVector[] calculated, ref IVector errors)
| Calculates error measures - maximum absolute value of the differences - for the specified arrays of prescribed and calculated output values in a set of sampling points. More...
static void | SaveJson (INeuralApproximator approximator, string filePath)
| Saves a neural network approximator to a file. If the neural netwoek is trained then internal state is also saved to a file. More...
static void | SaveJson (INeuralApproximator approximator, string filePath, bool saveInternalState)
| Saves a neural network approximator to a file. More...
static void | LoadJson (string filePath, ref INeuralApproximator approximatorRestored)
| Loads network from a file. More...
static void | ExampleSaveNetwork (string directoryPath, string fileName, string internalStateFileName)
| Example of saving an entire trained neural network to a file, and then restoring it from a file. Network internal state is saved by the SaveNetwork() method that is specific to the type of the network, therefore it is saved to a separate file. The path of this file is savad with the network approximator object itself. Network is saved only once. More...
static void | ExampleSaveNetwork (string directoryPath, string fileName, string internalStateFileName, bool saveRestored)
| Example of saving an entire trained neural network to a file, and then restoring it from a file. Network internal state is saved by the SaveNetwork() method that is specific to the type of the network, therefore it is saved to a separate file. The path of this file is savad with the network approximator object itself. If the saveRestored flag parameter is true then the restored file ia saved again for comparison. More...
static INeuralApproximator | ExampleQuadratic ()
| Example demonstrating usage of the neural network approximator. A quadratic function with random coefficients is sampled with enough samples to exactly specify function coefficients, a part of samples is randomly designated as verification points, then neural network is created and trained on training samples, and it is verified how close the obtained approximation matches actual function in verification points. More...
static INeuralApproximator | ExampleQuadratic (int inputLength, int outputLength)
| Example demonstrating usage of the neural network approximator. A quadratic function with random coefficients is sampled with enough samples to exactly specify function coefficients, a part of samples is randomly designated as verification points, then neural network is created and trained on training samples, and it is verified how close the obtained approximation matches actual function in verification points. More...
static INeuralApproximator | ExampleQuadratic (int inputLength, int outputLength, int outputLevel, int maxEpochs)
| Example demonstrating usage of the neural network approximator. A quadratic function with random coefficients is sampled with enough samples to exactly specify function coefficients, a part of samples is randomly designated as verification points, then neural network is created and trained on training samples, and it is verified how close the obtained approximation matches actual function in verification points. More...

## Detailed Description

Approximator of response by using neural networks, based on the AforgeDotNet library. $A Igor Mar11;

## Constructor & Destructor Documentation

IG.Num.NeuralApproximatorAforgeIT.NeuralApproximatorAforgeIT | ( |  | ) |
| inline

## Member Function Documentation

override void IG.Num.NeuralApproximatorAforgeIT.PrepareNetworksArray | ( |  | ) |
| inline protected virtual

Prepares the networks array (allocates it if necessary) for storing all neural networks of the current object.

Implements IG.Num.NeuralApproximatorBase.

virtual IActivationFunction IG.Num.NeuralApproximatorAforgeIT.CreateActivationFunction | ( |  | ) |
| inline protected virtual

override void IG.Num.NeuralApproximatorAforgeIT.PrepareNetwork | ( |  | ) |
| inline

Prepares neural network for use. If networks have not yet been created accordinfg to internal data, they are created. If networks are already prepared then this method does nothing.

Some things suc as creation of a neural network follow the pattern of lazy evaluation.

Implements IG.Num.INeuralApproximator.

override void IG.Num.NeuralApproximatorAforgeIT.CreateNetwork | ( |  | ) |
| inline

Creates the neural network anew. It the network already exists on the current object, it is discarded.

Implements IG.Num.INeuralApproximator.

override void IG.Num.NeuralApproximatorAforgeIT.ResetNetwork | ( |  | ) |
| inline

Resets the neural network(s), clears information generated during training.

Implements IG.Num.INeuralApproximator.

override void IG.Num.NeuralApproximatorAforgeIT.DestroyNetwork | ( |  | ) |
| inline

Destroys the neural network.

Implements IG.Num.INeuralApproximator.

override void IG.Num.NeuralApproximatorAforgeIT.SaveNetworkSpecific | ( | string | fileOrDirectoryPath | ) |
| inline protected virtual

Saves the state of the neural network to the specified file. If the file already exists, its contents are overwritten.

Parameters

  fileOrDirectoryPath | Path to the file into which the network is saved or of a directory into which network is saved (in this case default names are generated).

Implements IG.Num.NeuralApproximatorBase.

override void IG.Num.NeuralApproximatorAforgeIT.LoadNetworkSpecific | ( | string | fileOrDirectoryPath | ) |
| inline protected virtual

Restores neural network from a file where it has been stored before.

Parameters

  fileOrDirectoryPath | Path to the file from which the neural network is read.

Implements IG.Num.NeuralApproximatorBase.

double [][] IG.Num.NeuralApproximatorAforgeIT.GetSingleNetworkTrainingOutput | ( | int | whichNetwork | ) |
| inline protected

Prepares and returns outputs for the specific network in the case with multiple networks.

Parameters

  whichNetwork | Specifies which network the outputs are prepared for.

override void IG.Num.NeuralApproximatorAforgeIT.PrepareInternalTrainingData | ( |  | ) |
| inline protected virtual

Prepares internal training data that is needed by the native training algorithm.

Implements IG.Num.NeuralApproximatorBase.

References IG.Num.SampledDataElement.InputParameters, and IG.Num.SampledDataElement.OutputValues.

override void IG.Num.NeuralApproximatorAforgeIT.TrainNetworkSpecific | ( | int | numEpochs | ) |
| inline protected virtual

Trains neural network wiht the specified data, performing the specified number of epochs. The maximal number of epochs that is set on the current object does not have any effect in this method, and the method can perform more epochs tha specified by that limit.

Parameters

  numEpochs | Number of epochs used in training of the network.

This method just enforces a fixed number of epochs and can be used to form more complex training procedures. Most common method used for training is that without arguments, which takse into account various tolerances that may be set on this object and the maximal number of epochs.

Implements IG.Num.NeuralApproximatorBase.

override void IG.Num.NeuralApproximatorAforgeIT.CalculateOutput | ( | IVector | input,
|  | ref IVector | output
| ) |  |
| inline

Calculates and returns the approximated output values corresponding to the specified inputs, by using the current neural network(s).

Parameters

  input | Input parameters.
  output | Vector where approximated values are stored.

Returns
  Vector of output values generated by the trained neural network.

Implements IG.Num.IVectorApproximator.

## Member Data Documentation

ActivationNetwork [] IG.Num.NeuralApproximatorAforgeIT._networks
| protected

Network(s) used for approximation.

BackPropagationLearning [] IG.Num.NeuralApproximatorAforgeIT._teachers
| protected

Teachers used for network training.

double [][] IG.Num.NeuralApproximatorAforgeIT._trainingInputsAForge
| private

double [][] IG.Num.NeuralApproximatorAforgeIT._trainingOutputsAForge
| private

double [][] IG.Num.NeuralApproximatorAforgeIT._singleNetworkOutputs = null
| private

## Property Documentation

double [][] IG.Num.NeuralApproximatorAforgeIT.TrainingInputsAForge
| get private set protected

Gets or sets training inputs.

double [][] IG.Num.NeuralApproximatorAforgeIT.TrainingOutputsAForge
| get set protected

Gets or sets training outputs.

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

- extensions/iglibneural/neural/NeuralApproximators/extended_to_merge/NeuralApproximatorAforgeIT.cs