Mercurial > pylearn
view algorithms/sgd.py @ 527:3eb59514b534
bugfix. fix an import bug that I don't understand the cause.
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Mon, 17 Nov 2008 13:16:33 -0500 |
parents | fbfd3932fd00 |
children |
line wrap: on
line source
from theano.compile import module from theano import tensor as T class StochasticGradientDescent(module.FancyModule): def __init__(self, params, gparams, lr=None): super(StochasticGradientDescent, self).__init__() self.lr = lr if lr is not None else module.Member(T.dscalar()) self.params = params self.gparams = gparams self.updates = dict((p, p - self.lr * g) for p, g in zip(self.params, self.gparams))