# HG changeset patch # User James Bergstra # Date 1227846434 18000 # Node ID 7de7fa19fb9be509d6a55d1c022c4743e477e9da # Parent b52c1a8811a60ffe5cc83d3af12c90bfe9698871 added WEIRD_STUFF flag to sgd. Relates to theano ticket 238 diff -r b52c1a8811a6 -r 7de7fa19fb9b pylearn/algorithms/sgd.py --- a/pylearn/algorithms/sgd.py Thu Nov 27 23:16:52 2008 -0500 +++ b/pylearn/algorithms/sgd.py Thu Nov 27 23:27:14 2008 -0500 @@ -6,6 +6,8 @@ from .minimizer import minimizer_factory +WEIRD_STUFF = True + class StochasticGradientDescent(module.FancyModule): """Fixed stepsize gradient descent""" def __init__(self, args, cost, params, gradients=None, stepsize=None): @@ -22,7 +24,8 @@ elif isinstance(stepsize, T.TensorResult): self.stepsize = stepsize else: - if 1: #TODO: why is this necessary? why does the else clause not work? + if WEIRD_STUFF: + #TODO: why is this necessary? why does the else clause not work? self.stepsize = module.Member(T.dscalar()) self.stepsize_init = stepsize else: @@ -43,7 +46,7 @@ args, cost, updates=self.updates) def _instance_initialize(self, obj): - if 1: + if WEIRD_STUFF: obj.stepsize = self.stepsize_init else: pass