Beispiel #1
0
    def test_StepSizer_step_will_increase_if_stable(self):
        start = 0.5
        ss = utils.StepSizer(start)
        assert ss.next() == start
        ss.update(1.0)
        ss.update(0.5)
        ss.update(0.4)
        ss.update(0.1)

        assert ss.next() > start
Beispiel #2
0
    def test_StepSizer_step_will_decrease_if_unstable(self):
        start = 0.95
        ss = utils.StepSizer(start)
        assert ss.next() == start
        ss.update(1.0)
        ss.update(2.0)
        ss.update(1.0)
        ss.update(2.0)

        assert ss.next() < start
Beispiel #3
0
 def test_StepSizer_step_will_decrease_if_explodes(self):
     start = 0.5
     ss = utils.StepSizer(start)
     assert ss.next() == start
     ss.update(20.0)
     assert ss.next() < start