Exemple #1
0
    public NNetwork InitialiseCopy(int hiddenLayerCount, int hiddenNeuronCoint)
    {
        NNetwork n = new NNetwork();
        List <Matrix <float> > newWeights = new List <Matrix <float> >();

        for (int i = 0; i < this.weights.Count; i++)
        {
            Matrix <float> currentWeight = Matrix <float> .Build.Dense(weights[i].RowCount, weights[i].ColumnCount);

            for (int x = 0; x < currentWeight.RowCount; x++)
            {
                for (int y = 0; y < currentWeight.ColumnCount; y++)
                {
                    currentWeight[x, y] = weights[i][x, y];
                }
            }
            newWeights.Add(currentWeight);
        }
        List <float> newBisaes = new List <float>();

        newBisaes.AddRange(biases);

        n.weights = newWeights;
        n.biases  = newBisaes;

        n.InitialiseHidden(hiddenLayerCount, hiddenNeuronCoint);
        return(n);
    }