Ejemplo n.º 1
0
        public double CalculateError(Dataset.Dataset dataset, double[] netParameters)
        {
            var error = 0.0;

            foreach (var sample in dataset)
            {
                var classification = CalculateOutput(sample.Input, netParameters);

                for (var i = 0; i < sample.Classification.Length; i++)
                {
                    error += Math.Pow(sample.Classification[i] - classification[i], 2);
                }
            }

            return(error / dataset.Count());
        }
Ejemplo n.º 2
0
 public FitnessFunction(ANN ann, Dataset.Dataset dataset)
 {
     Ann     = ann;
     Dataset = dataset;
 }