Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created January 27, 2018 12:30
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/e7e4268b32cdce52327ddd88ef67ac99 to your computer and use it in GitHub Desktop.
Save NMZivkovic/e7e4268b32cdce52327ddd88ef67ac99 to your computer and use it in GitHub Desktop.
public class NeuralLayer
{
public List<INeuron> Neurons;
public NeuralLayer()
{
Neurons = new List<INeuron>();
}
/// <summary>
/// Connecting two layers.
/// </summary>
public void ConnectLayers(NeuralLayer inputLayer)
{
var combos = Neurons.SelectMany(neuron => inputLayer.Neurons, (neuron, input) => new { neuron, input });
combos.ToList().ForEach(x => x.neuron.AddInputNeuron(x.input));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment