Skip to content

Commit 7970209

Browse files
authored
Merge pull request Azure#930 from Azure/release_update/Release-44
update samples from Release-44 as a part of SDK release
2 parents b881f78 + 24f8651 commit 7970209

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

tutorials/image-classification-mnist-data/img-classification-part1-training.ipynb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,15 @@
239239
"source": [
240240
"# make sure utils.py is in the same directory as this code\n",
241241
"from utils import load_data\n",
242+
"import glob\n",
243+
"\n",
242244
"\n",
243245
"# note we also shrink the intensity values (X) from 0-255 to 0-1. This helps the model converge faster.\n",
244-
"X_train = load_data(os.path.join(data_folder, \"train-images-idx3-ubyte.gz\"), False) / 255.0\n",
245-
"X_test = load_data(os.path.join(data_folder, \"t10k-images-idx3-ubyte.gz\"), False) / 255.0\n",
246-
"y_train = load_data(os.path.join(data_folder, \"train-labels-idx1-ubyte.gz\"), True).reshape(-1)\n",
247-
"y_test = load_data(os.path.join(data_folder, \"t10k-labels-idx1-ubyte.gz\"), True).reshape(-1)\n",
246+
"X_train = load_data(glob.glob(os.path.join(data_folder,\"**/train-images-idx3-ubyte.gz\"), recursive=True)[0], False) / 255.0\n",
247+
"X_test = load_data(glob.glob(os.path.join(data_folder,\"**/t10k-images-idx3-ubyte.gz\"), recursive=True)[0], False) / 255.0\n",
248+
"y_train = load_data(glob.glob(os.path.join(data_folder,\"**/train-labels-idx1-ubyte.gz\"), recursive=True)[0], True).reshape(-1)\n",
249+
"y_test = load_data(glob.glob(os.path.join(data_folder,\"**/t10k-labels-idx1-ubyte.gz\"), recursive=True)[0], True).reshape(-1)\n",
250+
"\n",
248251
"\n",
249252
"# now let's show some randomly chosen images from the traininng set.\n",
250253
"count = 0\n",

tutorials/image-classification-mnist-data/img-classification-part2-deploy.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,12 @@
308308
"source": [
309309
"from utils import load_data\n",
310310
"import os\n",
311+
"import glob\n",
311312
"\n",
312313
"data_folder = os.path.join(os.getcwd(), 'data')\n",
313314
"# note we also shrink the intensity values (X) from 0-255 to 0-1. This helps the neural network converge faster\n",
314-
"X_test = load_data(os.path.join(data_folder, 't10k-images-idx3-ubyte.gz'), False) / 255.0\n",
315-
"y_test = load_data(os.path.join(data_folder, 't10k-labels-idx1-ubyte.gz'), True).reshape(-1)"
315+
"X_test = load_data(glob.glob(os.path.join(data_folder,\"**/t10k-images-idx3-ubyte.gz\"), recursive=True)[0], False) / 255.0\n",
316+
"y_test = load_data(glob.glob(os.path.join(data_folder,\"**/t10k-labels-idx1-ubyte.gz\"), recursive=True)[0], True).reshape(-1)"
316317
]
317318
},
318319
{

0 commit comments

Comments
 (0)