Beispiel #1
0
 //Constructor
 public AxonLayer(NeuronLayer previousneuronlayer, NeuronLayer nextneuronlayer)
 {
     this.previousneuronlayer = previousneuronlayer;
     this.nextneuronlayer     = nextneuronlayer;
     this.weights             = Matrix.Random(nextneuronlayer.nbneurons, previousneuronlayer.nbneurons, 1.0 / Math.Sqrt(previousneuronlayer.nbneurons));
     this.weightsupdate       = new Matrix(nextneuronlayer.nbneurons, previousneuronlayer.nbneurons);
 }
Beispiel #2
0
        //constructor for the other layers (builds all the links with the previous layer)
        public NeuronLayer(int nbneurons, NeuronLayer previousneuronlayer)
        {
            neuron_activation = new Vector(nbneurons);
            neuron_bias       = Vector.Random(nbneurons, 1);
            this.biasupdate   = new Vector(nbneurons);
            this.nbneurons    = nbneurons;

            this.previousneuronlayer            = previousneuronlayer;
            previousneuronlayer.nextneuronlayer = this;

            AxonLayer axonlayer = new AxonLayer(this.previousneuronlayer, this);

            this.previousaxonlayer            = axonlayer;
            previousneuronlayer.nextaxonlayer = axonlayer;
        }