Skip to content

Commit f5ed4b9

Browse files
committed
Found some missing text so I fixed it. Also change data directories.
1 parent 03a39c0 commit f5ed4b9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Image Classifier Project.ipynb

+6-5
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@
5353
"metadata": {},
5454
"outputs": [],
5555
"source": [
56-
"train_dir = 'train'\n",
57-
"valid_dir = 'valid'\n",
58-
"test_dir = 'test'"
56+
"data_dir = 'flowers'\n",
57+
"train_dir = data_dir + '/train'\n",
58+
"valid_dir = data_dir + '/valid'\n",
59+
"test_dir = data_dir + '/test'"
5960
]
6061
},
6162
{
@@ -270,9 +271,9 @@
270271
"source": [
271272
"## Class Prediction\n",
272273
"\n",
273-
"Once you can get images in the correct format \n",
274+
"Once you can get images in the correct format, it's time to write a function for making predictions with your model. A common practice is to predict the top 5 or so (usually called top-$K$) most probable classes. You'll want to calculate the class probabilities then find the $K$ largest values.\n",
274275
"\n",
275-
"To get the top $K$ largest values in a tensor use [`x.topk(k)`](http://pytorch.org/docs/master/torch.html#torch.topk). This method returns both the highest `k` probabilities and the indices of those probabilities corresponding to the classes. You need to convert from these indices to the actual class labels using `class_to_idx` which hopefully you added to the model or from an `ImageFolder` you used to load the data ([see here](#Save-the-checkpoint)). Make sure to invert the dictio\n",
276+
"To get the top $K$ largest values in a tensor use [`x.topk(k)`](http://pytorch.org/docs/master/torch.html#torch.topk). This method returns both the highest `k` probabilities and the indices of those probabilities corresponding to the classes. You need to convert from these indices to the actual class labels using `class_to_idx` which hopefully you added to the model or from an `ImageFolder` you used to load the data ([see here](#Save-the-checkpoint)). Make sure to invert the dictionary so you get a mapping from index to class as well.\n",
276277
"\n",
277278
"Again, this method should take a path to an image and a model checkpoint, then return the probabilities and classes.\n",
278279
"\n",

0 commit comments

Comments
 (0)