Skip to content

Commit

Permalink
l = 100
Browse files Browse the repository at this point in the history
  • Loading branch information
surajkota committed Aug 19, 2022
1 parent bcf330e commit 35701de
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sagemaker-python-sdk/pytorch_mnist/pytorch_mnist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@
"from torchvision.datasets import MNIST\n",
"from torchvision import transforms\n",
"\n",
"MNIST.mirrors = [\n",
" \"https://sagemaker-sample-files.s3.amazonaws.com/datasets/image/MNIST/\"\n",
"]\n",
"MNIST.mirrors = [\"https://sagemaker-sample-files.s3.amazonaws.com/datasets/image/MNIST/\"]\n",
"\n",
"MNIST(\n",
" \"data\",\n",
Expand Down Expand Up @@ -608,11 +606,7 @@
"\n",
"data_dir = \"data/MNIST/raw\"\n",
"with gzip.open(os.path.join(data_dir, \"t10k-images-idx3-ubyte.gz\"), \"rb\") as f:\n",
" images = (\n",
" np.frombuffer(f.read(), np.uint8, offset=16)\n",
" .reshape(-1, 28, 28)\n",
" .astype(np.float32)\n",
" )\n",
" images = np.frombuffer(f.read(), np.uint8, offset=16).reshape(-1, 28, 28).astype(np.float32)\n",
"\n",
"mask = random.sample(range(len(images)), 16) # randomly select some of the test images\n",
"mask = np.array(mask, dtype=np.int)\n",
Expand Down

0 comments on commit 35701de

Please sign in to comment.