Esempio n. 1
0
        public NeuralLayer(NeuralLayer neuralLayer)
        {
            if (neuralLayer == null)
            {
                throw new ArgumentNullException("Neural layer has not been provided");
            }

            CloneNeuralLayer(neuralLayer);
        }
Esempio n. 2
0
 private void CloneNeuralLayer(NeuralLayer neuralLayer)
 {
     _random  = neuralLayer._random;
     _weights = new double[neuralLayer._weights.Length][];
     _neurons = new Neuron[neuralLayer._neurons.Length];
     _biases  = new double[neuralLayer._biases.Length];
     for (int i = 0; i < _weights.Length; i++)
     {
         _biases[i]  = neuralLayer._biases[i];
         _weights[i] = new double[neuralLayer._weights[0].Length];
         for (int j = 0; j < _weights[i].Length; j++)
         {
             _weights[i][j] = neuralLayer._weights[i][j];
         }
     }
 }