/// <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); }
/// <summary> /// Flows image dataset from text file. /// </summary> /// <param name="fileName">Name of the file which stores the image dataset information.</param> /// <returns></returns> public static ImageDataGenerator FlowFromText(string fileName) { ImageDataGenerator result = new ImageDataGenerator() { FileName = fileName, }; result.GenType = ImageGenType.FromTextFile; return(result); }