|
9 | 9 | # http://arrayfire.com/licenses/BSD-3-Clause
|
10 | 10 | ########################################################
|
11 | 11 |
|
| 12 | +import os |
12 | 13 | import sys
|
13 | 14 | sys.path.insert(0, '../common')
|
14 | 15 | from idxio import read_idx
|
@@ -41,8 +42,10 @@ def classify(arr, k, expand_labels):
|
41 | 42 |
|
42 | 43 |
|
43 | 44 | def setup_mnist(frac, expand_labels):
|
44 | | - idims, idata = read_idx('../../assets/examples/data/mnist/images-subset') |
45 | | - ldims, ldata = read_idx('../../assets/examples/data/mnist/labels-subset') |
| 45 | + root_path = os.path.dirname(os.path.abspath(__file__)) |
| 46 | + file_path = root_path + '/../../assets/examples/data/mnist/' |
| 47 | + idims, idata = read_idx(file_path + 'images-subset') |
| 48 | + ldims, ldata = read_idx(file_path + 'labels-subset') |
46 | 49 |
|
47 | 50 | idims.reverse()
|
48 | 51 | numdims = len(idims)
|
|
0 commit comments