Mercurial > pylearn
diff pylearn/shared/layers/tests/test_sigmoidal_layer.py @ 1447:fbe470217937
Use .get_value() and .set_value() of shared instead of the .value property
author | Pascal Lamblin <lamblinp@iro.umontreal.ca> |
---|---|
date | Wed, 16 Mar 2011 20:20:02 -0400 |
parents | 912be602c3ac |
children |
line wrap: on
line diff
--- a/pylearn/shared/layers/tests/test_sigmoidal_layer.py Tue Mar 08 12:50:37 2011 -0500 +++ b/pylearn/shared/layers/tests/test_sigmoidal_layer.py Wed Mar 16 20:20:02 2011 -0400 @@ -24,8 +24,8 @@ updates = [(p, p - numpy.asarray(0.01, dtype=dtype)*gp) for p,gp in zip(params, tensor.grad(cost, params)) ] f = pfunc([x, y], cost, updates=updates) - w0 = layer.w.value.copy() - b0 = layer.b.value.copy() + w0 = layer.w.get_value(borrow=False) + b0 = layer.b.get_value(borrow=False) xval = numpy.asarray(rng.rand(bsize, n_in), dtype=dtype) yval = numpy.asarray(rng.randint(0,2,bsize), dtype='int64') @@ -35,7 +35,7 @@ print i, 'rval', fN assert f0 > 6 - assert fN < 2 + assert fN < 2 - assert numpy.all(w0 != layer.w.value) - assert numpy.all(b0 != layer.b.value) + assert numpy.all(w0 != layer.w.get_value(borrow=True)) + assert numpy.all(b0 != layer.b.get_value(borrow=True))