コード例 #1
0
        public void TestDefaultBehaviorIsNoDecay()
        {
            var afm = new SigmoidUserAsymmetricFactorModel()
            {
                LearnRate = 1.1f, NumIter = 10, Ratings = TestUtils.CreateRatings()
            };

            afm.Train();
            Assert.AreEqual(1.1f, afm.current_learnrate);
        }
コード例 #2
0
        public void TestDecay()
        {
            var afm = new SigmoidUserAsymmetricFactorModel()
            {
                LearnRate = 1.0f, Decay = 0.5f,
                NumIter   = 1, Ratings = TestUtils.CreateRatings()
            };

            afm.Train();
            Assert.AreEqual(0.5f, afm.current_learnrate);

            afm.Iterate();
            Assert.AreEqual(0.25f, afm.current_learnrate);
        }