private void SetActivationFunction(ActivationFunction.Functions function)
 {
     foreach (Layer l in Layers)
     {
         l.SetActivationFunction(function);
     }
 }
        public NeuralNetwork(int totalInputNodes, int totalHiddenLayers, int totalHiddenNodes, int totalOutputNodes, ActivationFunction.Functions function)
        {
            TotalInputNodes   = totalInputNodes;
            TotalHiddenLayers = totalHiddenLayers;
            TotalHiddenNodes  = totalHiddenNodes;
            TotalOutputNodes  = totalOutputNodes;
            learningRate      = 0.0075;

            CreateLayers();
            SetActivationFunction(function);
            VisualSetup();
        }
 public NeuralNetwork(int totalInputNodes, int totalHiddenLayers, int totalHiddenNodes, int totalOutputNodes, ActivationFunction.Functions function) : this(totalInputNodes, totalHiddenLayers, totalHiddenNodes, totalOutputNodes)
 {
     SetActivationFunction(function);
 }
Exemple #4
0
 public void SetActivationFunction(ActivationFunction.Functions function)
 {
     ActivationFunction = new ActivationFunction(function);
 }
        public NeuralNetwork(double[,] WeightsInputToHidden, double[,] WeightsHiddenToOutput, double[,] BiasHidden, double[,] BiasOutput, ActivationFunction.Functions function)
        {
            TotalInputNodes  = WeightsInputToHidden.GetLength(1);
            TotalHiddenNodes = WeightsInputToHidden.GetLength(0);
            TotalOutputNodes = WeightsHiddenToOutput.GetLength(0);

            this.WeightsInputToHidden = Matrix <double> .Build.DenseOfArray(WeightsInputToHidden);

            this.WeightsHiddenToOutput = Matrix <double> .Build.DenseOfArray(WeightsHiddenToOutput);

            this.BiasHidden = Matrix <double> .Build.DenseOfArray(BiasHidden);

            this.BiasOutput = Matrix <double> .Build.DenseOfArray(BiasOutput);

            ActivationFunction = new ActivationFunction(function);

            VisualSetup();
        }