# HG changeset patch # User James Bergstra # Date 1269035685 14400 # Node ID 519e82748a553b35de3078d3defe4e1b9e765de2 # Parent 7edb78ba4c5b9816fc116dc404e718020f80f84d logreg - added name parameter and autonaming of logreg shared variables diff -r 7edb78ba4c5b -r 519e82748a55 pylearn/shared/layers/logreg.py --- a/pylearn/shared/layers/logreg.py Thu Mar 18 15:39:32 2010 -0400 +++ b/pylearn/shared/layers/logreg.py Fri Mar 19 17:54:45 2010 -0400 @@ -15,12 +15,14 @@ update_locals(self, locals()) @classmethod - def new(cls, input, n_in, n_out, dtype=None): + def new(cls, input, n_in, n_out, dtype=None, name=None): if dtype is None: dtype = input.dtype + if name is None: + name = cls.__name__ cls._debug('allocating params w, b', n_in, n_out, dtype) - w = shared(numpy.zeros((n_in, n_out), dtype=dtype)) - b = shared(numpy.zeros((n_out,), dtype=dtype)) + w = shared(numpy.zeros((n_in, n_out), dtype=dtype), name='%s.w'%name) + b = shared(numpy.zeros((n_out,), dtype=dtype), name='%s.b'%name) return cls(input, w, b, params=[w,b])