# HG changeset patch # User Frederic Bastien # Date 1303915384 14400 # Node ID cac29ca79a741e0b61549e18ec8787fdf145d4fc # Parent b24ed2aa077e29457b78b8b650a1f9d25efb1d49 small fix to sgd. This should remove buildbot error. diff -r b24ed2aa077e -r cac29ca79a74 pylearn/gd/sgd.py --- a/pylearn/gd/sgd.py Wed Apr 20 16:55:18 2011 -0400 +++ b/pylearn/gd/sgd.py Wed Apr 27 10:43:04 2011 -0400 @@ -79,7 +79,8 @@ raise TypeError('stepsize must be a scalar', stepsize) self.params = params - self.gparams = theano.tensor.grad(cost, self.params) if gradients is None else gradients + self.gparams = [theano.tensor.grad(cost, self.params)] if gradients is None else gradients + assert len(self.params) == len(self.gparams) self._updates = (dict((p, p - self.stepsize * g) for p, g in zip(self.params, self.gparams))) if updates is not None: