# HG changeset patch # User Frederic Bastien # Date 1351714791 14400 # Node ID 5972fab3cfd24ab263196a19de622ecf01099feb # Parent 6397233f3ccdb02470f18529e34eb146d81a5650 make ranzato_hinton_2010_op work with float64 for a DLT on mcrbm test. diff -r 6397233f3ccd -r 5972fab3cfd2 pylearn/dataset_ops/image_patches.py --- a/pylearn/dataset_ops/image_patches.py Wed Oct 31 16:12:57 2012 -0400 +++ b/pylearn/dataset_ops/image_patches.py Wed Oct 31 16:19:51 2012 -0400 @@ -74,6 +74,11 @@ dct = ranzato_hinton_2010(path) return dct['whitendata'].astype('float32') +def ranzato_hinton_2010_whitened_patches_f64(path=None): + """Return the pca of the data, which is 10240 x 105 + """ + dct = ranzato_hinton_2010(path) + return dct['whitendata'].astype('float64') def undo_pca_filters_of_ranzato_hinton_2010(X, path=None): """Return tuple (R,G,B,None) of matrices for matrix `X` of filters (one per row) @@ -110,7 +115,9 @@ # rasterizing or not raise NotImplementedError('only pca data is provided') - if dtype != 'float32': + if dtype == "float64" and fn is ranzato_hinton_2010_whitened_patches: + fn = ranzato_hinton_2010_whitened_patches_f64 + elif dtype != 'float32': raise NotImplementedError('dtype not float32') op = TensorFnDataset(dtype,