Ejemplo n.º 1
0
 public NeuralNetwork(NeuralNetworkState savedState)
 {
     InputLayerSize  = savedState.inputLayerSize;
     HiddenLayerSize = savedState.hiddenLayerSize;
     OutputLayerSize = savedState.outputLayerSize;
     inputs          = new double[InputLayerSize];
     hiddenLayer     = new Neuron[HiddenLayerSize];
     for (int i = 0; i < hiddenLayer.Length; i++)
     {
         hiddenLayer[i] = new Neuron(savedState.hiddenLayerState[i]);
     }
     outputLayer = new Neuron[OutputLayerSize];
     for (int i = 0; i < outputLayer.Length; i++)
     {
         outputLayer[i] = new Neuron(savedState.outputLayerState[i]);
     }
     Eta = savedState.eta;
 }
Ejemplo n.º 2
0
 private void loadPresetNeuralNetwork()
 {
     System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer(typeof(NeuralNetworkState));
     if (File.Exists(@"presetNN.xml"))
     {
         var file = new StreamReader(@"presetNN.xml");
         NeuralNetworkState presetState = (NeuralNetworkState)reader.Deserialize(file);
         file.Close();
         PresetNeuralNetwork             = new NeuralNetworkUCI(presetState);
         textBoxPresetNeuralNetwork.Text =
             "Preset Neural Network:\r\n" +
             PresetNeuralNetwork.GetInfo() + "\r\n" +
             testNeuralNetwork(PresetNeuralNetwork);
         selectCharacterImage(selectedCharacterImage);
     }
     else
     {
         textBoxPresetNeuralNetwork.Text = "Could not load preset neural network. \r\nMake sure presetNN.xml exists in application folder.";
     }
 }
Ejemplo n.º 3
0
 public NeuralNetworkUCI(NeuralNetworkState savedState) : base(savedState)
 {
 }