예제 #1
0
        public LayerViewModel()
        {
            //   this.Network = new Network(new IdentityLayer(5), new DenseLayer(5, 2, new IdentityActivation(), new CrossEntropy()));

            this.Layer = new DenseLayer(4, 3, Activations.First(), LossFunctions.First());
            this.Layer.Initialize();

            this.Input          = (new double[this.Layer.NbInput]).Select(x => rnd.NextDouble()).ToArray();
            this.ExpectedOutput = Utils.OneHot(this.Layer.NbOutput, rnd.Next(0, this.Layer.NbOutput - 1));
            this.Weights        = this.Layer.Weights.ToDataTable();
            this.errors         = new double[this.Layer.NbOutput];

            this.Calculate();

            this.targetError = 0.01;
            this.learnRate   = 0.01;
        }