Inheritance: global::System.IDisposable
Beispiel #1
0
 public training_data(training_data data) : this(fannfixedPINVOKE.new_training_data__SWIG_1(training_data.getCPtr(data)), true)
 {
     if (fannfixedPINVOKE.SWIGPendingException.Pending)
     {
         throw fannfixedPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #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));
        }
Beispiel #3
0
 public void init_weights(training_data data)
 {
     fannfixedPINVOKE.neural_net_init_weights(swigCPtr, training_data.getCPtr(data));
     if (fannfixedPINVOKE.SWIGPendingException.Pending)
     {
         throw fannfixedPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #4
0
 public void merge_train_data(training_data data)
 {
     fannfixedPINVOKE.training_data_merge_train_data(swigCPtr, training_data.getCPtr(data));
     if (fannfixedPINVOKE.SWIGPendingException.Pending)
     {
         throw fannfixedPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #5
0
 /* Constructor: TrainingData
  * Reads a file that stores training data.
  *
  *  See also:
  *      <ReadTrainFromFile>, <SetTrainData> or <CreateTrainFromCallback>
  */
 public TrainingData(string filename)
 {
     InternalData = new FannWrapperFixed.training_data();
     ReadTrainFromFile(filename);
     if (!ReadTrainFromFile(filename))
     {
         throw new ArgumentException("Cannot read data from \"{0}\"", filename);
     }
 }
        /* Constructor: TrainingData
           Reads a file that stores training data.

            See also:
                <ReadTrainFromFile>, <SetTrainData> or <CreateTrainFromCallback>
        */
        public TrainingData(string filename)
        {
            InternalData = new FannWrapperFixed.training_data();
            ReadTrainFromFile(filename);
            if (!ReadTrainFromFile(filename))
            {
                throw new ArgumentException("Cannot read data from \"{0}\"", filename);
            }
        }
Beispiel #7
0
        public float test_data(training_data data)
        {
            float ret = fannfixedPINVOKE.neural_net_test_data(swigCPtr, training_data.getCPtr(data));

            if (fannfixedPINVOKE.SWIGPendingException.Pending)
            {
                throw fannfixedPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Beispiel #8
0
 public void merge_train_data(training_data data)
 {
     fannfixedPINVOKE.training_data_merge_train_data(swigCPtr, training_data.getCPtr(data));
     if (fannfixedPINVOKE.SWIGPendingException.Pending) throw fannfixedPINVOKE.SWIGPendingException.Retrieve();
 }
 internal TrainingData(training_data other)
 {
     InternalData = other;
 }
Beispiel #10
0
 public void init_weights(training_data data)
 {
     fannfixedPINVOKE.neural_net_init_weights(swigCPtr, training_data.getCPtr(data));
     if (fannfixedPINVOKE.SWIGPendingException.Pending) throw fannfixedPINVOKE.SWIGPendingException.Retrieve();
 }
        /* Constructor: TrainingData

            Copy constructor constructs a copy of the training data.
            Corresponds to the C API <fann_duplicate_train_data at http://libfann.github.io/fann/docs/files/fann_train-h.html#fann_duplicate_train_data> function.
        */
        public TrainingData(TrainingData data)
        {
            InternalData = new FannWrapperFixed.training_data(data.InternalData);
        }
Beispiel #12
0
 public float test_data(training_data data)
 {
     float ret = fannfixedPINVOKE.neural_net_test_data(swigCPtr, training_data.getCPtr(data));
     if (fannfixedPINVOKE.SWIGPendingException.Pending) throw fannfixedPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
        /* Constructor: TrainingData

            Default constructor creates an empty training data.
            Use <ReadTrainFromFile>, <SetTrainData> or <CreateTrainFromCallback> to initialize.
        */
        public TrainingData()
        {
            InternalData = new FannWrapperFixed.training_data();
        }
        /*********************************************************************/
        /* 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));
        }
Beispiel #15
0
 public training_data(training_data data)
     : this(fannfixedPINVOKE.new_training_data__SWIG_1(training_data.getCPtr(data)), true)
 {
     if (fannfixedPINVOKE.SWIGPendingException.Pending) throw fannfixedPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #16
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(training_data obj)
 {
     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
Beispiel #17
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(training_data obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Beispiel #18
0
 /* Constructor: TrainingData
  *
  *  Default constructor creates an empty training data.
  *  Use <ReadTrainFromFile>, <SetTrainData> or <CreateTrainFromCallback> to initialize.
  */
 public TrainingData()
 {
     InternalData = new FannWrapperFixed.training_data();
 }
Beispiel #19
0
 /* Constructor: TrainingData
  *
  *  Copy constructor constructs a copy of the training data.
  *  Corresponds to the C API <fann_duplicate_train_data at http://libfann.github.io/fann/docs/files/fann_train-h.html#fann_duplicate_train_data> function.
  */
 public TrainingData(TrainingData data)
 {
     InternalData = new FannWrapperFixed.training_data(data.InternalData);
 }