changeset 1411:68fdb895f53f

allow to load the ule labels.
author Frederic Bastien <nouiz@nouiz.org>
date Wed, 02 Feb 2011 12:39:35 -0500
parents e7844692e6e2
children e1b5092b4a53
files pylearn/datasets/utlc.py
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/datasets/utlc.py	Wed Feb 02 11:20:34 2011 -0500
+++ b/pylearn/datasets/utlc.py	Wed Feb 02 12:39:35 2011 -0500
@@ -119,6 +119,22 @@
     else:
         return train, valid, test
     
+def load_ndarray_label(name):
+    """ Load the train,valid,test data for the dataset `name`
+        and return it in ndarray format.
+    
+        This is only available for the toy dataset ule.
+    """
+    assert name in ['ule']
+    trname,vname,tename = [os.path.join(config.data_root(),
+                                        'UTLC','filetensor',
+                                        name+'_'+subset+'.ft') 
+                           for subset in ['trainl','validl','testl']]
+    trainl = load_filetensor(trname)
+    validl = load_filetensor(vname)
+    testl = load_filetensor(tename)
+    return trainl, validl, testl
+
 def load_filetensor(fname):
     f = None
     try: