changeset 1477:48efafaaf7fb

Add function for loading the transfer labels of utlc
author Pascal Lamblin <lamblinp@iro.umontreal.ca>
date Sat, 21 May 2011 01:03:10 -0400
parents 8c10bda4bb5f
children 1e4dc99a3b13
files pylearn/datasets/utlc.py
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/datasets/utlc.py	Fri May 20 16:53:00 2011 -0400
+++ b/pylearn/datasets/utlc.py	Sat May 21 01:03:10 2011 -0400
@@ -110,7 +110,7 @@
         else:
             raise Exception("This dataset don't have its normalization defined")
     if transfer:
-        transfer = load_filetensor(os.path.join(config.data_root(),"UTLC","filetensor",name+"_transfer.ft"))
+        transfer = load_ndarray_transfer(name)
         return train, valid, test, transfer
     else:
         return train, valid, test
@@ -179,6 +179,17 @@
     else:
         return train, valid, test
 
+def load_ndarray_transfer(name):
+    """
+    Load the transfer labels for the training set of data set `name`.
+
+    It will be returned in ndarray format.
+    """
+    assert name in ['avicenna','harry','rita','sylvester','terry','ule']
+    transfer = load_filetensor(os.path.join(config.data_root(), 'UTLC',
+        'filetensor', name+'_transfer.ft'))
+    return transfer
+
 def load_ndarray_label(name):
     """ Load the train,valid,test data for the dataset `name`
         and return it in ndarray format.