FANN C# TrainingData Fixed | |
TrainingData | TrainingData is used to create and manipulate training data used by the NeuralNet |
Functions | |
TrainingData | Default constructor creates an empty training data. |
TrainingData | Copy constructor constructs a copy of the training data. |
TrainingData | Reads a file that stores training data. |
Dispose | Disposes of the training data. |
ReadTrainFromFile | Reads a file that stores training data. |
SaveTrain | Save the training structure to a file, with the format as specified in ReadTrainFromFile |
SaveTrainToFixed | Saves the training structure to a fixed point data file. |
ShuffleTrainData | Shuffles training data, randomizing the order. |
MergeTrainData | Merges the data into the data contained in the TrainingData. |
Properties | |
TrainDataLength | Returns the number of training patterns in the TrainingData. |
InputCount | Returns the number of inputs in each of the training patterns in the TrainingData. |
OutputCount | Returns the number of outputs in each of the training patterns in the TrainingData. |
Input | Grant access to the encapsulated data since many situations and applications creates the data from sources other than files or uses the training data for testing and related functions. |
InputAccessor | An alternative to Input that returns an accessor object that grants access to to the input data with no copying. |
Output | Grant access to the encapsulated data since many situations and applications creates the data from sources other than files or uses the training data for testing and related functions. |
OutputAccessor | An alternative to Output that returns an accessor object that grants access to to the input data with no copying. |
Functions | |
GetTrainInput | Gets the training input data at the given position |
GetTrainOutput | Gets the training output data at the given position |
SetTrainData | Set the training data to the input and output data provided. |
SetTrainData | Set the training data to the input and output data provided. |
CreateTrainFromCallback | Creates the training data from a user supplied function. |
ScaleInputTrainData | Scales the inputs in the training data to the specified range. |
ScaleOutputTrainData | Scales the outputs in the training data to the specified range. |
ScaleTrainData | Scales the inputs and outputs in the training data to the specified range. |
SubsetTrainData | Changes the training data to a subset, starting at position pos and length elements forward. |
Delegates | |
DataCreateCallback | Called for each trianing data input/output pair to create the entire training data set. |
IDisposable |
FANNCSharp.Fixed.TrainingData |
TrainingData is used to create and manipulate training data used by the NeuralNet
Encapsulation of a training_data class training_data and associated C++ API functions.
Functions | |
TrainingData | Default constructor creates an empty training data. |
TrainingData | Copy constructor constructs a copy of the training data. |
TrainingData | Reads a file that stores training data. |
Dispose | Disposes of the training data. |
ReadTrainFromFile | Reads a file that stores training data. |
SaveTrain | Save the training structure to a file, with the format as specified in ReadTrainFromFile |
SaveTrainToFixed | Saves the training structure to a fixed point data file. |
ShuffleTrainData | Shuffles training data, randomizing the order. |
MergeTrainData | Merges the data into the data contained in the TrainingData. |
Properties | |
TrainDataLength | Returns the number of training patterns in the TrainingData. |
InputCount | Returns the number of inputs in each of the training patterns in the TrainingData. |
OutputCount | Returns the number of outputs in each of the training patterns in the TrainingData. |
Input | Grant access to the encapsulated data since many situations and applications creates the data from sources other than files or uses the training data for testing and related functions. |
InputAccessor | An alternative to Input that returns an accessor object that grants access to to the input data with no copying. |
Output | Grant access to the encapsulated data since many situations and applications creates the data from sources other than files or uses the training data for testing and related functions. |
OutputAccessor | An alternative to Output that returns an accessor object that grants access to to the input data with no copying. |
Functions | |
GetTrainInput | Gets the training input data at the given position |
GetTrainOutput | Gets the training output data at the given position |
SetTrainData | Set the training data to the input and output data provided. |
SetTrainData | Set the training data to the input and output data provided. |
CreateTrainFromCallback | Creates the training data from a user supplied function. |
ScaleInputTrainData | Scales the inputs in the training data to the specified range. |
ScaleOutputTrainData | Scales the outputs in the training data to the specified range. |
ScaleTrainData | Scales the inputs and outputs in the training data to the specified range. |
SubsetTrainData | Changes the training data to a subset, starting at position pos and length elements forward. |
Delegates | |
DataCreateCallback | Called for each trianing data input/output pair to create the entire training data set. |
public TrainingData()
Default constructor creates an empty training data. Use ReadTrainFromFile, SetTrainData or CreateTrainFromCallback to initialize.
public TrainingData( TrainingData data )
Copy constructor constructs a copy of the training data. Corresponds to the C API fann_duplicate_train_data function.
public bool ReadTrainFromFile( string filename )
Reads a file that stores training data.
TrainDataLength InputCount OutputCount inputdata seperated by space outputdata seperated by space . . . inputdata seperated by space outputdata seperated by space
<NeuralNet::TrainOnData>, SaveTrain, fann_read_train_from_file
This function appears in FANN >= 1.0.0
public bool SaveTrain( string filename )
Save the training structure to a file, with the format as specified in ReadTrainFromFile
The function returns true on success and false on failure.
ReadTrainFromFile, SaveTrainToFixed, fann_save_train
This function appears in FANN >= 1.0.0.
public bool SaveTrainToFixed( string filename, uint decimalPoint )
Saves the training structure to a fixed point data file.
This function is very useful for testing the quality of a fixed point network.
The function returns true on success and false on failure.
SaveTrain, fann_save_train_to_fixed
This function appears in FANN >= 1.0.0.
public void MergeTrainData( TrainingData data )
Merges the data into the data contained in the TrainingData.
This function appears in FANN >= 1.1.0.
public uint TrainDataLength { get }
Returns the number of training patterns in the TrainingData.
InputCount, OutputCount, fann_length_train_data
This function appears in FANN >= 2.0.0.
public uint InputCount { get }
Returns the number of inputs in each of the training patterns in the TrainingData.
OutputCount, TrainDataLength, fann_num_input_train_data
This function appears in FANN >= 2.0.0.
public uint OutputCount { get }
Returns the number of outputs in each of the training patterns in the TrainingData.
InputCount, TrainDataLength, fann_num_output_train_data
This function appears in FANN >= 2.0.0.
public int[][] Input { get }
Grant access to the encapsulated data since many situations and applications creates the data from sources other than files or uses the training data for testing and related functions.
If you only need a specfic output data then it is preferrable to use the GetTrainInput method as this property has to duplicate the entirity of the input data in the managed layer.
If you need repeated fast access to all input data consider using InputAccessor
A array of arrays of input training data
Output, InputAccessor, SetTrainData
This function appears in FANN >= 2.0.0.
public ArrayAccessor InputAccessor { get }
An alternative to Input that returns an accessor object that grants access to to the input data with no copying.
A ArrayAccessor that can access the input arrray
public int[][] Output { get }
Grant access to the encapsulated data since many situations and applications creates the data from sources other than files or uses the training data for testing and related functions.
If you only need a specfic output data then it is preferrable to use the GetTrainOutput method as this property has to duplicate the entirity of the output data in the managed layer.
If you need repeated fast access to all output data consider using OutputAccessor
A arrray of arrays of output training data
Input, OutputAccessor, SetTrainData
This function appears in FANN >= 2.0.0.
public ArrayAccessor OutputAccessor { get }
An alternative to Output that returns an accessor object that grants access to to the input data with no copying.
A ArrayAccessor that can access the output arrray
public void SetTrainData( int[][] input, int[][] output )
Set the training data to the input and output data provided.
A copy of the data is made so there are no restrictions on the allocation of the input/output data.
input | The set of inputs (an array of arrays of int data) |
output | The set of desired outputs (an array of arrays of int data) |
public void SetTrainData( uint dataLength, int[] input, int[] output )
Set the training data to the input and output data provided.
A copy of the data is made so there are no restrictions on the allocation of the input/output data..
dataLength | The number of training data |
input | The set of inputs (an array with the dimension dataLength*inputCount) |
output | The set of desired outputs (an array with the dimension dataLength*inputCount) |
public void CreateTrainFromCallback( uint dataCount, uint inputCount, uint outputCount, DataCreateCallback callback )
Creates the training data from a user supplied function. As the training data are numerable (data 1, data 2...), the user must write a function that receives the number of the training data set (input,output) and returns the set.
dataCount | The number of training data |
inputCount | The number of inputs per training data |
outputCount | The number of ouputs per training data |
callback | The user suplied delegate |
number | The number of the training data set |
inputCount | The number of inputs per training data |
outputCount | The number of ouputs per training data |
input | The set of inputs |
output | The set of desired outputs |
ReadTrainFromFile, <NeuralNet::TrainOnData>, fann_create_train_from_callback
This function appears in FANN >= 2.1.0
public void ScaleInputTrainData( int new_min, int new_max )
Scales the inputs in the training data to the specified range.
A simplified scaling method, which is mostly useful in examples where it’s known that all the data will be in one range and it should be transformed to another range.
It is not recommended to use this on subsets of data as the complete input range might not be available in that subset.
For more powerful scaling, please consider <NeuralNet::ScaleTrain>
ScaleOutputTrainData, ScaleTrainData, fann_scale_input_train_data
This function appears in FANN >= 2.0.0.
public void ScaleOutputTrainData( int new_min, int new_max )
Scales the outputs in the training data to the specified range.
A simplified scaling method, which is mostly useful in examples where it’s known that all the data will be in one range and it should be transformed to another range.
It is not recommended to use this on subsets of data as the complete input range might not be available in that subset.
For more powerful scaling, please consider <NeuralNet::ScaleTrain>
ScaleInputTrainData, ScaleTrainData, fann_scale_output_train_data
This function appears in FANN >= 2.0.0.
public void ScaleTrainData( int new_min, int new_max )
Scales the inputs and outputs in the training data to the specified range.
A simplified scaling method, which is mostly useful in examples where it’s known that all the data will be in one range and it should be transformed to another range.
It is not recommended to use this on subsets of data as the complete input range might not be available in that subset.
For more powerful scaling, please consider <NeuralNet::ScaleTrain>
ScaleOutputTrainData, ScaleInputTrainData, fann_scale_train_data
This function appears in FANN >= 2.0.0.
public void SubsetTrainData( uint pos, uint length )
Changes the training data to a subset, starting at position pos and length elements forward. Use the copy constructor to work on a new copy of the training data.
TrainingData fullDataSet = new TrainingData(); fullDataSet.ReadTrainFromFile("somefile.train"); TrainingData smallDataSet = new TrainingData(fullDataSet); smallDataSet->SubsetTrainData(0, 2); // Only use first two // Use smallDataSet ... small_data_set.Dispose();
<fann_subset_train_data http://libfann.github.io/fann/docs/files/fann_train-h.html#fann_subset_train_data>
This function appears in FANN >= 2.0.0.
public delegate void DataCreateCallback( uint number, uint inputCount, uint outputCount, int[] input, int[] output )
Called for each trianing data input/output pair to create the entire training data set.
number | The number of the training data set |
inputCount | The number of inputs per training data |
outputCount | The number of ouputs per training data |
input | The set of inputs |
output | The set of desired outputs |
Default constructor creates an empty training data.
public TrainingData()
Disposes of the training data.
public void Dispose()
Reads a file that stores training data.
public bool ReadTrainFromFile( string filename )
Save the training structure to a file, with the format as specified in ReadTrainFromFile
public bool SaveTrain( string filename )
Saves the training structure to a fixed point data file.
public bool SaveTrainToFixed( string filename, uint decimalPoint )
Shuffles training data, randomizing the order.
public void ShuffleTrainData()
Merges the data into the data contained in the TrainingData.
public void MergeTrainData( TrainingData data )
Returns the number of training patterns in the TrainingData.
public uint TrainDataLength { get }
Returns the number of inputs in each of the training patterns in the TrainingData.
public uint InputCount { get }
Returns the number of outputs in each of the training patterns in the TrainingData.
public uint OutputCount { get }
Grant access to the encapsulated data since many situations and applications creates the data from sources other than files or uses the training data for testing and related functions.
public int[][] Input { get }
An alternative to Input that returns an accessor object that grants access to to the input data with no copying.
public ArrayAccessor InputAccessor { get }
Grant access to the encapsulated data since many situations and applications creates the data from sources other than files or uses the training data for testing and related functions.
public int[][] Output { get }
An alternative to Output that returns an accessor object that grants access to to the input data with no copying.
public ArrayAccessor OutputAccessor { get }
Gets the training input data at the given position
public DataAccessor GetTrainInput( uint position )
Gets the training output data at the given position
public DataAccessor GetTrainOutput( uint position )
Set the training data to the input and output data provided.
public void SetTrainData( int[][] input, int[][] output )
Creates the training data from a user supplied function.
public void CreateTrainFromCallback( uint dataCount, uint inputCount, uint outputCount, DataCreateCallback callback )
Scales the inputs in the training data to the specified range.
public void ScaleInputTrainData( int new_min, int new_max )
Scales the outputs in the training data to the specified range.
public void ScaleOutputTrainData( int new_min, int new_max )
Scales the inputs and outputs in the training data to the specified range.
public void ScaleTrainData( int new_min, int new_max )
Changes the training data to a subset, starting at position pos and length elements forward.
public void SubsetTrainData( uint pos, uint length )
Called for each trianing data input/output pair to create the entire training data set.
public delegate void DataCreateCallback( uint number, uint inputCount, uint outputCount, int[] input, int[] output )