public void SetGetWeightTest()
        {
            double weight = 5;

            Synapse synapse = new Synapse();
            synapse.SetWeight(weight);

            Assert.AreEqual(synapse.GetWeight(), weight);
        }
        public void SetGetSignalTest()
        {
            double signal = 9;

            Synapse synapse = new Synapse();
            synapse.SetSignal(signal);

            Assert.AreEqual(synapse.GetSignal(), signal);
        }
Example #3
0
        // методы для соединения нейронов
        public void ConnectNeuron(Neuron neuron, double signal, double weight)
        {
            Synapse newSynapse = new Synapse();
            newSynapse.From = this;
            newSynapse.To = neuron;

            newSynapse.SetWeight(weight);
            newSynapse.SetSignal(signal);

            outputs.Add(newSynapse);
            neuron.inputs.Add(newSynapse);
        }
Example #4
0
 public void AddOutput(Synapse outputSynapse)
 {
     outputs.Add(outputSynapse);
 }
Example #5
0
 public void AddInput(Synapse inputSynapse)
 {
     inputs.Add(inputSynapse);
 }
        public NeuronLayer CreateOutputLayer(int countNeuron)
        {
            Neuron outputNeuron = null;
            Synapse outputSynapse = null;

            for (int i = 0; i < countNeuron; i++ )
            {
                outputNeuron = new Neuron();
                outputSynapse = new Synapse();

                outputSynapse.From = outputNeuron;
                outputNeuron.AddOutput(outputSynapse);

                outputLayer.AddNeuron(outputNeuron);
            }

            return outputLayer;
        }