Пример #1
0
        public void CanGetWeightsUpdate()
        {
            GradientDescent gd         = new GradientDescent(0.5, 1);
            WeightsMatrix   testMatrix = new WeightsMatrix(new double[, ] {
                { 1, 2, 3 }, { 2, 3, 4 }
            });
            WeightsMatrix result      = gd.WeightsUpdate(testMatrix);
            WeightsMatrix resultCheck = new WeightsMatrix(new double[, ] {
                { -0.5, -1.0, -1.5 }, { -1.0, -1.5, -2.0 }
            });

            Assert.AreEqual(resultCheck, result);
        }