Ejemplo n.º 1
0
        /// <summary>
        /// Initialze the trainer object. The error function is used to decide how much the output is wrong and where.
        /// </summary>
        public Trainer(SequentialNet nn, Func <float[], float[], bool, float[]> errorFunction, float learningRate, bool printError = true)
        {
            NeuralNet = nn;

            ErrorFunc = errorFunction;
            if (ErrorFunc == null)
            {
                throw new NullReferenceException("Error function is null.");
            }

            LearningRate = learningRate;

            this.printError = printError;
        }
Ejemplo n.º 2
0
 public BackPropagation(SequentialNet nn, Func <float[], float[], bool, float[]> errorFunction, float learningRate, bool printError = true)
     : base(nn, errorFunction, learningRate, printError)
 {
 }