Esempio n. 1
0
    public void Init(string layerName, ILayer previousLayer, ILayer nextLayer)
    {
        this.LayerName     = layerName;
        this.PreviousLayer = previousLayer;
        this.NextLayer     = nextLayer;

        this.Perceptrons = new Perceptron[ClassesNumber];

        //System.Random random = new System.Random();

        for (int i = 0; i < ClassesNumber; i++)
        {
            // Generate random weights and bias.
            //...

            Perceptrons[i] = new Perceptron(string.Format("P_{0}_{1}", LayerName, i),
                                            new decimal[PreviousLayer.GetInput().Length],
                                            0m);
        }

        ActivationFunction = ActivationFunctions.GetAppropriateActivationFunction(LayerActivationFunction);
    }