Exemplo n.º 1
0
        public Layer(int neurons, IActivation activation = null, bool addBias = false)
        {
            Activation = activation;

            for (int i = 0; i < neurons; i++)
            {
                Neurons.Add(new Neuron(this));
            }
            if (addBias)
            {
                Neurons.Add(new Neuron(this)
                {
                    IsBias = true
                });
            }
        }
Exemplo n.º 2
0
 internal void CreateActivation(StreamingContext context)
 {
     activation = IActivation.CreateActivation(activationType);
 }
Exemplo n.º 3
0
 public Neuron(int inputCount, IActivation activation)
 {
     this.activation = activation;
     Weights         = new double[inputCount];
 }