changeset 1498:0f326860210e

Merged
author Olivier Delalleau <delallea@iro>
date Thu, 01 Sep 2011 13:35:15 -0400
parents 3d4615ee96a4 (current diff) 93b8373c6735 (diff)
children f82b80c841b2
files
diffstat 5 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/algorithms/sparse_coding.py	Thu Sep 01 13:35:02 2011 -0400
+++ b/pylearn/algorithms/sparse_coding.py	Thu Sep 01 13:35:15 2011 -0400
@@ -152,8 +152,8 @@
 
 if __name__ == '__main__':
     logging.basicConfig(stream=sys.stderr)
-    logging.getLogger('main').setLevel(logging.INFO)
-    logging.getLogger('main').info('hello')
+    logging.getLogger('pylearn.algorithms.sparse_coding.main').setLevel(logging.INFO)
+    logging.getLogger('pylearn.algorithms.sparse_coding.main').info('hello')
 
     # load olshausen images
     reproduce_olshausen()
--- a/pylearn/dataset_ops/__init__.py	Thu Sep 01 13:35:02 2011 -0400
+++ b/pylearn/dataset_ops/__init__.py	Thu Sep 01 13:35:15 2011 -0400
@@ -1,4 +1,4 @@
 import logging
-logging.getLogger('dataset_ops').setLevel(logging.INFO)
+logging.getLogger('pylearn.dataset_ops').setLevel(logging.INFO)
 
 from protocol import Dataset, TensorDataset, TensorFnDataset  # protocol.py
--- a/pylearn/datasets/config.py	Thu Sep 01 13:35:02 2011 -0400
+++ b/pylearn/datasets/config.py	Thu Sep 01 13:35:15 2011 -0400
@@ -41,14 +41,16 @@
     if roots is None:
         roots = [data_root()]
     else:
-        roots = roots.split(':')
-    roots2 = []
-    #remove directory that don't exist
-    for root in roots:
-        if os.path.exists(root):
-            roots2.append(root)
-    data_roots.rval = roots2
-    return roots2
+        # Note that under Windows, we cannot use ':' as a delimiter because
+        # paths may contain this character. Thus we use ';' instead (similar to
+        # the PATH environment variable in Windows).
+        if sys.platform == 'win32':
+            roots = roots.split(';')
+        else:
+            roots = roots.split(':')
+    # Remove paths that are not directories.
+    data_roots.rval = [r for r in roots if os.path.isdir(r)]
+    return data_roots.rval
 
 
 def get_filepath_in_roots(*names):
--- a/pylearn/gd/sgd.py	Thu Sep 01 13:35:02 2011 -0400
+++ b/pylearn/gd/sgd.py	Thu Sep 01 13:35:15 2011 -0400
@@ -79,7 +79,10 @@
             raise TypeError('stepsize must be a scalar', stepsize)
 
         self.params = params
-        self.gparams = [theano.tensor.grad(cost, self.params)] if gradients is None else gradients
+        if gradients is None:
+            self.gparams = [theano.tensor.grad(cost, self.params)]
+        else:
+            self.gparams = gradients
         assert len(self.params) == len(self.gparams)
 
         self._updates = (dict((p, p - self.stepsize * g) for p, g in zip(self.params, self.gparams)))
--- a/pylearn/shared/layers/util.py	Thu Sep 01 13:35:02 2011 -0400
+++ b/pylearn/shared/layers/util.py	Thu Sep 01 13:35:15 2011 -0400
@@ -27,7 +27,7 @@
 
     """
     if name is None:
-        name = "layers.%s" % cls.__name__
+        name = "pylearn.shared.layers.%s" % cls.__name__
     cls._logger = logging.getLogger(name)
     if level:
         try: