public static string MakeUntilDoneGradientTrainer( [ExcelArgument(Description = "Name of trainer object to create.")] string name, [ExcelArgument(Description = "Maximum number of backpropagation steps to run. " + "Each step may be on-line or a batch step.")] int numEpochs, [ExcelArgument(Description = "Impact of each backpropagation step on weight adjustment.")] double learningRate, [ExcelArgument(Description = "Impact of previous backpropagation stepts each step's adjustment.")] double momentum, [ExcelArgument(Description = "Higher numbers help with keeping weights from becoming too large.")] double quadraticRegularization, [ExcelArgument(Description = "Number of training samples to evaluate for each backpropagation step.")] int batchSize, [ExcelArgument(Description = "Portion of the training set to use as validation set to check whether " + "training has improved performance of the neural network. " + "Must be between 0 and 1.")] double validationSetFraction, [ExcelArgument(Description = "Training will abort after there is no error improvement on validation set after " + "this number of backpropagation steps.")] int maxEpochsWithoutImprovement, [ExcelArgument(Description = "Number of backpropagation steps before checking for error improvement on " + "validation set.")] int epochsBetweenValidations, [ExcelArgument(Description = "Seed for random number generation.")] int seed) { var config = new UntilDoneGradientTrainer { NumEpochs = numEpochs, LearningRate = learningRate, Momentum = momentum, QuadraticRegularization = quadraticRegularization, BatchSize = batchSize, ValidationSetFraction = validationSetFraction, MaxEpochsWithoutImprovement = maxEpochsWithoutImprovement, EpochsBetweenValidations = epochsBetweenValidations, Seed = seed, }; config.Validate(); ObjectStore.Add(name, config); return(name); }
public void ShouldReturnValidationSetFraction() { var trainer = new UntilDoneGradientTrainer { ValidationSetFraction = 0.3 }; trainer.GetValidationSetFraction().Should().Be(0.3); }
public ValidateTests() { _trainer = new UntilDoneGradientTrainer { LearningRate = 0.1, NumEpochs = 100, ValidationSetFraction = 0.3, MaxEpochsWithoutImprovement = 10, }; }
private static UntilDoneGradientTrainer GetTrainer() { var trainer = new UntilDoneGradientTrainer { LearningRate = 0.5, Momentum = 2, NumEpochs = 1, QuadraticRegularization = 0.1, ShouldInitializeWeights = false, MaxEpochsWithoutImprovement = 100, ValidationSetFraction = 0.5 }; return(trainer); }