Esempio n. 1
0
        public NeuralNetworkGUI(InputLayer inputLayer, List <HiddenLayer> hiddenLayers, OutputLayer outputLayer, List <Layer> layers)
        {
            this.inputLayer   = inputLayer;
            this.hiddenLayers = hiddenLayers;
            this.outputLayer  = outputLayer;
            this.layers       = layers;

            neuronWidth  = 40;
            neuronHeight = 40;

            Layer largestLayer = layers.OrderByDescending(n => n.Neurons.Count()).First();

            int layoutColumns = layers.Count();
            int layoutRows    = largestLayer.Neurons.Count();

            Width  = neuronWidth * layoutColumns;
            Height = neuronHeight * layoutRows;

            Padding padding = new Padding();

            padding.All  = 10;
            this.Padding = padding;

            neuralNetworkLayout = CreateTable(layoutRows, layoutColumns);
            CreateNeurons();
            Controls.Add(neuralNetworkLayout);

            NeuronGUI neuronGUI = new NeuronGUI(inputLayer.Neurons[0]);
        }
Esempio n. 2
0
 private void CreateNeurons()
 {
     for (int i = 0; i < layers.Count(); i++)
     {
         for (int j = 0; j < layers[i].Neurons.Count(); j++)
         {
             NeuronGUI neuronGUI = new NeuronGUI(layers[i].Neurons[j]);
             neuralNetworkLayout.Controls.Add(neuronGUI, i, j);
         }
     }
 }