Mercurial > pylearn
comparison pylearn/algorithms/tests/test_regressor.py @ 1506:2f69c9932d9a
Fix test in float32.
author | Frederic Bastien <nouiz@nouiz.org> |
---|---|
date | Mon, 12 Sep 2011 10:56:38 -0400 |
parents | f7957524f76e |
children |
comparison
equal
deleted
inserted
replaced
1505:723e2d761985 | 1506:2f69c9932d9a |
---|---|
19 #data = numpy.random.rand(10, 100) | 19 #data = numpy.random.rand(10, 100) |
20 | 20 |
21 R = numpy.random.RandomState(100) | 21 R = numpy.random.RandomState(100) |
22 t1 = time.time() | 22 t1 = time.time() |
23 for i in xrange(1001): | 23 for i in xrange(1001): |
24 data = R.random_integers(0, 1, size = (10, 100)) | 24 data = R.random_integers(0, 1, size = (10, 100)).astype(theano.config.floatX) |
25 targets = data[:, 6].reshape((10, 1)) | 25 targets = data[:, 6].reshape((10, 1)) |
26 cost = model.update(data, targets) | 26 cost = model.update(data, targets) |
27 if i % 100 == 0: | 27 if i % 100 == 0: |
28 print i, '\t', cost, '\t', 1*(targets.T == model.classify(data).T) | 28 print i, '\t', cost, '\t', 1*(targets.T == model.classify(data).T) |
29 t2 = time.time() | 29 t2 = time.time() |