changeset 1289:092cd4cd2009

tinyimages - minor: removed inplace assumption and reduced min_dynamic_range
author James Bergstra <bergstrj@iro.umontreal.ca>
date Wed, 29 Sep 2010 18:36:49 -0400
parents a165f2666643
children 0ea25edd97e5
files pylearn/dataset_ops/tinyimages.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/dataset_ops/tinyimages.py	Wed Sep 29 18:35:40 2010 -0400
+++ b/pylearn/dataset_ops/tinyimages.py	Wed Sep 29 18:36:49 2010 -0400
@@ -57,14 +57,13 @@
         flat = imgstack.reshape((a,b*c))
         flat -= flat.mean(axis=1).reshape((a,1))
         flat /= numpy.maximum(flat.std(axis=1).reshape((a,1)),imaxscale)
-        # SHOULD CHANNEL VARIANCE BE STANDARDIZED?
-        #imgstack modified inplace
-    centre(X[:,:,:,0])
-    centre(X[:,:,:,1])
-    centre(X[:,:,:,2])
+        return flat.reshape((a,b,c))
+    X[:,:,:,0]=centre(X[:,:,:,0])
+    X[:,:,:,1]=centre(X[:,:,:,1])
+    X[:,:,:,2]=centre(X[:,:,:,2])
     return X
 
-def save_filters(X, fname, min_dynamic_range=1e-3, data_path=None):
+def save_filters(X, fname, min_dynamic_range=1e-8, data_path=None):
     """
     Save filters X (encoded as whitened images) in the original image space.
     """