Exemplo n.º 1
0
        private void CreateInpLayer()
        {
            var inputNeurons = new List <OneNeuron>();

            for (var i = 0; i < Topology.InputCount; i++)
            {
                var neuron = new OneNeuron(1, NeuronType.Input);
                inputNeurons.Add(neuron);
            }
            var inpLayer = new NLayer(inputNeurons, NeuronType.Input);

            Layers.Add(inpLayer);
        }
Exemplo n.º 2
0
        private void CreateOutLayer()
        {
            var outputNeurons = new List <OneNeuron>();
            var lastLayer     = Layers.Last();

            for (var i = 0; i < Topology.OutputCount; i++)
            {
                var neuron = new OneNeuron(lastLayer.Count, NeuronType.Output);
                outputNeurons.Add(neuron);
            }
            var outpLayer = new NLayer(outputNeurons, NeuronType.Output);

            Layers.Add(outpLayer);
        }
Exemplo n.º 3
0
 private void CreateHidLayers()
 {
     for (var j = 0; j < Topology.HiddenLayers.Count; j++)
     {
         var hiddenNeurons = new List <OneNeuron>();
         var lastLayer     = Layers.Last();
         for (var i = 0; i < Topology.HiddenLayers[j]; i++)
         {
             var neuron = new OneNeuron(lastLayer.Count);
             hiddenNeurons.Add(neuron);
         }
         var hiddenLayer = new NLayer(hiddenNeurons);
         Layers.Add(hiddenLayer);
     }
 }