Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created January 27, 2018 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/d31970f318d6b4fa8d3672b3bd37b180 to your computer and use it in GitHub Desktop.
Save NMZivkovic/d31970f318d6b4fa8d3672b3bd37b180 to your computer and use it in GitHub Desktop.
public class InputSynapse : ISynapse
{
internal INeuron _toNeuron;
public double Weight { get; set; }
public double Output { get; set; }
public double PreviousWeight { get; set; }
public InputSynapse(INeuron toNeuron)
{
_toNeuron = toNeuron;
Weight = 1;
}
public InputSynapse(INeuron toNeuron, double output)
{
_toNeuron = toNeuron;
Output = output;
Weight = 1;
PreviousWeight = 1;
}
public double GetOutput()
{
return Output;
}
public bool IsFromNeuron(Guid fromNeuronId)
{
return false;
}
public void UpdateWeight(double learningRate, double delta)
{
throw new InvalidOperationException("It is not allowed to call this method on Input Connecion");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment