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); }
// методы для соединения нейронов 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); }
public void AddOutput(Synapse outputSynapse) { outputs.Add(outputSynapse); }
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; }