# HG changeset patch # User Olivier Delalleau # Date 1243452356 14400 # Node ID 331f35215ea56c6097e49f9edef33eb28ad6f62f # Parent 3784ef7cdd71dd3be8566d91200cd0c666dbe4c4 Fixed the SGD tests diff -r 3784ef7cdd71 -r 331f35215ea5 pylearn/algorithms/tests/test_sgd.py --- a/pylearn/algorithms/tests/test_sgd.py Wed May 27 14:46:01 2009 -0400 +++ b/pylearn/algorithms/tests/test_sgd.py Wed May 27 15:25:56 2009 -0400 @@ -12,9 +12,9 @@ m.y = 5.0 for i in xrange(100): c = m.step_cost(3.0) - # print c, m.y + #print c[0], m.y - assert c < 1.0e-5 + assert c[0] < 1.0e-5 assert abs(m.y - (1.0 / 3)) < 1.0e-4 def test_sgd_stepsize_variable(): @@ -33,7 +33,7 @@ c = m.step_cost(3.0) # print c, m.y - assert c < 1.0e-5 + assert c[0] < 1.0e-5 assert abs(m.y - (1.0 / 3)) < 1.0e-4 @@ -63,6 +63,8 @@ c = m.step_cost(3.0) # print c, m.y - assert c < 1.0e-5 + assert c[0] < 1.0e-5 assert abs(m.y - (1.0 / 3)) < 1.0e-4 +if __name__ == '__main__': + test_sgd0()