Ejemplo n.º 1
0
        /*********************************************************************/

        /* Method: CreateTrainFromCallback
         * 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.
         *
         * Parameters:
         *   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
         *
         * Parameters for the user 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
         *
         * See also:
         *   <ReadTrainFromFile>, <NeuralNet::TrainOnData>,
         *   <fann_create_train_from_callback at http://libfann.github.io/fann/docs/files/fann_train-h.html#fann_create_train_from_callback>
         *
         *  This function appears in FANN >= 2.1.0
         */
        public void CreateTrainFromCallback(uint dataCount, uint inputCount, uint outputCount, DataCreateCallback callback)
        {
            InternalData = new FannWrapperDouble.training_data();
            Callback     = callback;
            RawCallback  = new data_create_callback(InternalCallback);
            fanndoublePINVOKE.training_data_create_train_from_callback(training_data.getCPtr(this.InternalData), dataCount, inputCount, outputCount, Marshal.GetFunctionPointerForDelegate(RawCallback));
        }
Ejemplo n.º 2
0
        /*********************************************************************/
        /* Method: CreateTrainFromCallback
           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.

           Parameters:
             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

           Parameters for the user 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

           See also:
             <ReadTrainFromFile>, <NeuralNet::TrainOnData>,
             <fann_create_train_from_callback at http://libfann.github.io/fann/docs/files/fann_train-h.html#fann_create_train_from_callback>

            This function appears in FANN >= 2.1.0
        */
        public void CreateTrainFromCallback(uint dataCount, uint inputCount, uint outputCount, DataCreateCallback callback)
        {
            InternalData = new FannWrapperFixed.training_data();
            Callback = callback;
            RawCallback = new data_create_callback(InternalCallback);
            fannfixedPINVOKE.training_data_create_train_from_callback(training_data.getCPtr(this.InternalData), dataCount, inputCount, outputCount, Marshal.GetFunctionPointerForDelegate(RawCallback));
        }