Example #1
0
 public static extern int CvANN_MLPTrain(
     IntPtr model,
     IntPtr trainData,
     IntPtr responses,
     IntPtr sampleWeights,
     IntPtr sampleIdx,
     ref MCvANN_MLP_TrainParams parameters,
     MlEnum.AnnMlpTrainingFlag flags);
Example #2
0
 /// <summary>
 /// Train the ANN_MLP model with the specific paramters
 /// </summary>
 /// <param name="trainData">The training data. A 32-bit floating-point, single-channel matrix, one vector per row</param>
 /// <param name="responses">A floating-point matrix of the corresponding output vectors, one vector per row. </param>
 /// <param name="sampleWeights">It is not null only for RPROP. The optional floating-point vector of weights for each sample. Some samples may be more important than others for training, e.g. user may want to gain the weight of certain classes to find the right balance between hit-rate and false-alarm rate etc</param>
 /// <param name="parameters">The parameters for ANN_MLP</param>
 /// <param name="flag">The traning flag</param>
 /// <returns>The number of done iterations</returns>
 public int Train(
     Matrix <float> trainData,
     Matrix <float> responses,
     Matrix <float> sampleWeights,
     MCvANN_MLP_TrainParams parameters,
     MlEnum.AnnMlpTrainingFlag flag)
 {
     return
         (MlInvoke.CvANN_MLPTrain(
              _ptr,
              trainData.Ptr,
              responses.Ptr,
              sampleWeights == null ? IntPtr.Zero : sampleWeights.Ptr,
              IntPtr.Zero,
              ref parameters,
              flag));
 }