# HG changeset patch # User James Bergstra # Date 1257893994 18000 # Node ID 2fffbfa419202cd8f7efcd296d7060d7dc36a21e # Parent 6298876b2b013c1f4b4d6eda6ab7b11f6373c197# Parent c3e7ae2bdb4bc99d390149187fde98e0e67fed3d merge diff -r 6298876b2b01 -r 2fffbfa41920 pylearn/dataset_ops/cifar10.py --- a/pylearn/dataset_ops/cifar10.py Mon Nov 09 14:55:08 2009 -0500 +++ b/pylearn/dataset_ops/cifar10.py Tue Nov 10 17:59:54 2009 -0500 @@ -13,7 +13,7 @@ import theano from protocol import TensorFnDataset # protocol.py __init__.py -from .memo import memo +from .memo import memo # memo.py def _unpickle(filename, dtype): #implements loading as well as dtype-conversion and dtype-scaling diff -r 6298876b2b01 -r 2fffbfa41920 pylearn/dataset_ops/memo.py --- a/pylearn/dataset_ops/memo.py Mon Nov 09 14:55:08 2009 -0500 +++ b/pylearn/dataset_ops/memo.py Tue Nov 10 17:59:54 2009 -0500 @@ -20,6 +20,7 @@ def forget(): for k in cache.keys(): del cache[k] + rval.cache = cache rval.forget = forget rval.__name__ = 'memo@%s'%f.__name__ return rval diff -r 6298876b2b01 -r 2fffbfa41920 pylearn/shared/layers/lecun1998.py --- a/pylearn/shared/layers/lecun1998.py Mon Nov 09 14:55:08 2009 -0500 +++ b/pylearn/shared/layers/lecun1998.py Tue Nov 10 17:59:54 2009 -0500 @@ -96,8 +96,12 @@ w_shp = (n_filters, n_imgs) + filter_shape b_shp = (n_filters,) - w = shared(numpy.asarray(rng.uniform(low=-.05, high=.05, size=w_shp), dtype=dtype)) - b = shared(numpy.asarray(rng.uniform(low=-.05, high=.05, size=b_shp), dtype=dtype)) + #TODO: make w_range a parameter to new as well? + w_range = (-1.0 / numpy.sqrt(filter_shape[0] * filter_shape[1] * n_imgs), + 1.0 / numpy.sqrt(filter_shape[0] * filter_shape[1] * n_imgs)) + + w = shared(numpy.asarray(rng.uniform(low=w_range[0], high=w_range[1], size=w_shp), dtype=dtype)) + b = shared(numpy.asarray(rng.uniform(low=-.0, high=0., size=b_shp), dtype=dtype)) if isinstance(squash_fn, str): squash_fn = squash(squash_fn) diff -r 6298876b2b01 -r 2fffbfa41920 pylearn/shared/layers/rust2005.py --- a/pylearn/shared/layers/rust2005.py Mon Nov 09 14:55:08 2009 -0500 +++ b/pylearn/shared/layers/rust2005.py Tue Nov 10 17:59:54 2009 -0500 @@ -241,8 +241,8 @@ b_shp = (n_filters,) if w_range is None: - w_low = -2.0/numpy.sqrt(image_shape[0] * image_shape[1]) - w_high = 2.0/numpy.sqrt(image_shape[0] * image_shape[1]) + w_low = -2.0/numpy.sqrt(image_shape[0] * image_shape[1] * n_channels) + w_high = 2.0/numpy.sqrt(image_shape[0] * image_shape[1] * n_channels) else: w_low, w_high = w_range