public static Dendrite Copy(Dendrite input) { Neuron neuron; var inputNeuron = input.Neuron as Input; if (inputNeuron != null) { neuron = Input.Copy(inputNeuron); } else { neuron = Dynamic.Copy((Dynamic)input.Neuron); } Dendrite output = new Dendrite(neuron, input.Weight); return(output); }
/** * reweight * Sets the weight of the given dendrite based on its error. * @param dendrite (Dendrite) to be reweighted * @param error (double) */ private void Reweight(Dendrite dendrite, double error, NeuralPathway path = null) { var weight = dendrite.Weight + LearningRate * error * Derivative(GetOutput(path)) * dendrite.Neuron.GetOutput(path); dendrite.Weight = weight; }
public static Dynamic Copy(Dynamic input) { return(new Dynamic(Dendrite.Copy(input.Dendrites), input.Name, input.Threshold)); }
public static Input Copy(Input input) { return(new Input(Dendrite.Copy(input.Dendrites), input.Name, input.Threshold, input.Value)); }