Mercurial > pylearn
diff pylearn/shared/layers/tests/test_kouh2008.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 | c635d1df51a1 |
children |
line wrap: on
line diff
--- a/pylearn/shared/layers/tests/test_kouh2008.py Tue Mar 08 12:50:37 2011 -0500 +++ b/pylearn/shared/layers/tests/test_kouh2008.py Wed Mar 16 20:20:02 2011 -0400 @@ -60,7 +60,9 @@ out = LogisticRegression.new(layer.output, n_out, 2) cost = out.nll(y).sum() #joint optimization except for one of the linear filters - out.w.value += 0.1 * rng.rand(*out.w.value.shape) + out.w.set_value((out.w.get_value(borrow=True) + + 0.1 * rng.rand(*out.w.get_value(borrow=True).shape)), + borrow=True) params = layer.params[:-2] mode = None updates = [(p, p - numpy.asarray(0.001, dtype=dtype)*gp) for p,gp in zip(params, tensor.grad(cost, params)) ]