Mercurial > pylearn
changeset 891:fc9779dcd710
some backport to python 2.4
author | Frederic Bastien <nouiz@nouiz.org> |
---|---|
date | Tue, 05 Jan 2010 10:48:59 -0500 |
parents | 57ac1af9c17c |
children | a13142cbeabd |
files | pylearn/shared/layers/__init__.py pylearn/shared/layers/kording2004.py pylearn/shared/layers/kouh2008.py pylearn/shared/layers/lecun1998.py pylearn/shared/layers/logreg.py pylearn/shared/layers/rust2005.py pylearn/shared/layers/sigmoidal_layer.py |
diffstat | 7 files changed, 17 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/pylearn/shared/layers/__init__.py Tue Nov 17 15:20:40 2009 -0500 +++ b/pylearn/shared/layers/__init__.py Tue Jan 05 10:48:59 2010 -0500 @@ -1,14 +1,14 @@ # logreg.py -from .logreg import LogisticRegression +from pylearn.shared.layers.logreg import LogisticRegression # sigmoidal_layer.py -from .sigmoidal_layer import SigmoidalLayer +from pylearn.shared.layers.sigmoidal_layer import SigmoidalLayer # exponential_mean.py -from .exponential_mean import ExponentialMean +from pylearn.shared.layers.exponential_mean import ExponentialMean # sgd.py -from .sgd import StochasticGradientDescent, HalflifeStopper +from pylearn.shared.layers.sgd import StochasticGradientDescent, HalflifeStopper # kording from kording2004 import Kording2004
--- a/pylearn/shared/layers/kording2004.py Tue Nov 17 15:20:40 2009 -0500 +++ b/pylearn/shared/layers/kording2004.py Tue Jan 05 10:48:59 2010 -0500 @@ -2,7 +2,7 @@ import theano.tensor from hpu.theano_outgoing import mean, var, cov -from .exponential_mean import ExponentialMean # exponential_mean.py +from pylearn.shared.layers.exponential_mean import ExponentialMean # exponential_mean.py import logging _logger = logging.getLogger('kording2004')
--- a/pylearn/shared/layers/kouh2008.py Tue Nov 17 15:20:40 2009 -0500 +++ b/pylearn/shared/layers/kouh2008.py Tue Jan 05 10:48:59 2010 -0500 @@ -21,7 +21,7 @@ from theano.tensor.nnet import softplus from theano.sandbox.softsign import softsign from theano.compile.sandbox import shared -from .util import add_logging, update_locals +from pylearn.shared.layers.util import add_logging, update_locals try: from PIL import Image @@ -243,9 +243,12 @@ if rows is None and cols is None: rows = int(numpy.sqrt(n_out)) if cols is None: - cols = n_out // rows + (1 if n_out % rows else 0) + cols = n_out // rows + if n_out % rows: cols +=1 if rows is None: - rows = n_out // cols + (1 if n_out % cols else 0) + rows = n_out // cols + if n_out % cols: + rows+=1 filter_shape = self.filter_shape height = rows * (row_gap + filter_shape[0]) - row_gap
--- a/pylearn/shared/layers/lecun1998.py Tue Nov 17 15:20:40 2009 -0500 +++ b/pylearn/shared/layers/lecun1998.py Tue Jan 05 10:48:59 2010 -0500 @@ -11,8 +11,8 @@ from theano.sandbox.conv import ConvOp from theano.sandbox.downsample import DownsampleFactorMax -from .util import update_locals -from .squash import squash +from pylearn.shared.layers.util import update_locals +from pylearn.shared.layers.squash import squash class LeNetConvPool(object): """
--- a/pylearn/shared/layers/logreg.py Tue Nov 17 15:20:40 2009 -0500 +++ b/pylearn/shared/layers/logreg.py Tue Jan 05 10:48:59 2010 -0500 @@ -4,7 +4,7 @@ import theano from theano.compile.sandbox import shared from theano.tensor import nnet -from .util import update_locals, add_logging +from pylearn.shared.layers.util import update_locals, add_logging class LogisticRegression(object): def __init__(self, input, w, b, params=[]):
--- a/pylearn/shared/layers/rust2005.py Tue Nov 17 15:20:40 2009 -0500 +++ b/pylearn/shared/layers/rust2005.py Tue Jan 05 10:48:59 2010 -0500 @@ -30,7 +30,7 @@ from theano.tensor.nnet import softplus from theano.sandbox.conv import ConvOp -from .util import update_locals, add_logging +from pylearn.shared.layers.util import update_locals, add_logging def rust2005_act_from_filters(linpart, E_quad, S_quad, eps): """Return rust2005 activation from linear filter responses, as well as E and S terms
--- a/pylearn/shared/layers/sigmoidal_layer.py Tue Nov 17 15:20:40 2009 -0500 +++ b/pylearn/shared/layers/sigmoidal_layer.py Tue Jan 05 10:48:59 2010 -0500 @@ -7,8 +7,8 @@ import theano from theano import tensor from theano.compile.sandbox import shared, pfunc -from .util import update_locals, add_logging -from .squash import squash +from pylearn.shared.layers.util import update_locals, add_logging +from pylearn.shared.layers.squash import squash class SigmoidalLayer(object):