Пример #1
0
 /// <summary>
 /// Trains the model for a fixed number of epochs.
 /// </summary>
 /// <param name="train">The train image generator.</param>
 /// <param name="epoches">The no. of trainin epoches.</param>
 /// <param name="batchSize">Size of the batch for training.</param>
 /// <param name="validation">The validation image generator.</param>
 public void Train(ImageDataGenerator train, int epoches, int batchSize, ImageDataGenerator validation = null)
 {
     OnTrainingStart();
     trainPredict   = new ImgGenTrainPredict(modelOut, lossFunc, lossName, metricFunc, metricName, learners, featureVariable, labelVariable);
     TrainingResult = trainPredict.Train(train, validation, epoches, batchSize, OnEpochStart, OnEpochEnd, OnBatchStart, OnBatchEnd);
     OnTrainingEnd(TrainingResult);
 }
Пример #2
0
 /// <summary>
 /// Trains the model for a fixed number of epochs.
 /// </summary>
 /// <param name="train">The training dataset.</param>
 /// <param name="epoches">The no. of trainin epoches.</param>
 /// <param name="batchSize">Size of the batch for training.</param>
 /// <param name="validation">The validation dataset.</param>
 /// <param name="shuffle">Shuffle the dataset while training</param>
 public void Train(XYFrame train, int epoches, int batchSize, XYFrame validation = null, bool shuffle = false)
 {
     OnTrainingStart();
     trainPredict   = new DataFrameTrainPredict(modelOut, lossFunc, lossName, metricFunc, metricName, learners, featureVariable, labelVariable);
     TrainingResult = trainPredict.Train(train, validation, epoches, batchSize, OnEpochStart, OnEpochEnd, OnBatchStart, OnBatchEnd, shuffle);
     OnTrainingEnd(TrainingResult);
 }