internal async Task InitTrain() { await Reset(); CurrentDemo.TrainingEnded -= TrainingEnded; CurrentDemo.TrainingEnded += TrainingEnded; if (string.IsNullOrWhiteSpace(HiddenLayers) == false) { CurrentDemo.HiddenLayers = HiddenLayers.Split(',').Select(l => int.Parse(l)).ToArray(); } else { CurrentDemo.HiddenLayers = new int[] { }; } CurrentDemo.Speed = SpeedValue; CurrentDemo.LearningRate = LearningRate; CurrentDemo.TargetError = TargetError; CurrentDemo.CreateNeuralNetwork(); TotalSteps = CurrentDemo.TotalSteps; TotalError = CurrentDemo.TotalError; Input = string.Join(",", CurrentDemo.TrainingSet[0]); Output = string.Join(",", CurrentDemo.NeuralNetwork.Update(CurrentDemo.TrainingSet[0])); TargetOutput = string.Join(",", CurrentDemo.Targets[0]); var scene = new NeuralNetworkScene(CurrentDemo.NeuralNetwork); await _game.Start(scene); }
public TrainingModel Prepare() { var hiddenLayers = HiddenLayers.Split(';') .Select(x => Convert.ToInt32(x)) .ToList(); return(new TrainingModel { TrainingData = _trainingDataModel, LearningRate = Convert.ToDouble(LearningRate), MinError = Convert.ToDouble(MinError), NoOfEpochs = Convert.ToInt32(_noEpochs), HiddenLayers = hiddenLayers, ActivationFunction = _selectedActivationFunction, NeuralNetworkName = _neuralNetworkName, NeuralNetworkSavePath = _neuralNetworkSavePath, }); }