changeset 1484:83d3c9ee6d65

* changed MNIST dataset to use config.get_filepath_in_roots mechanism
author gdesjardins
date Tue, 05 Jul 2011 11:01:51 -0400
parents 4727a7e4d506
children f7b348e6a98e
files pylearn/datasets/MNIST.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/datasets/MNIST.py	Tue Jul 05 10:58:19 2011 -0400
+++ b/pylearn/datasets/MNIST.py	Tue Jul 05 11:01:51 2011 -0400
@@ -6,8 +6,8 @@
 import numpy
 
 from pylearn.io.pmat import PMat
-from pylearn.datasets.config import data_root # config
 from pylearn.datasets.dataset import Dataset
+import config
 
 def head(n=10, path=None):
     """Load the first MNIST examples.
@@ -18,7 +18,9 @@
 
     """
     if path is None:
-      path = os.path.join(data_root(), 'mnist','mnist_all.pmat')
+        # dataset lookup through $PYLEARN_DATA_ROOT
+        _path = os.path.join('mnist', 'mnist_all.pmat')
+        path = config.get_filepath_in_roots(_path)
 
     dat = PMat(fname=path)