Skip to content

Commit 173bdfb

Browse files
authored
Merge pull request aws#83 from awslabs/image_classification_notebooks
Image classification notebooks
2 parents 5036cd7 + dddd9b7 commit 173bdfb

File tree

2 files changed

+47
-18
lines changed

2 files changed

+47
-18
lines changed

introduction_to_amazon_algorithms/imageclassification_caltech/Image-classification-fulltraining.ipynb

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
{
4747
"cell_type": "code",
4848
"execution_count": null,
49-
"metadata": {},
49+
"metadata": {
50+
"collapsed": true
51+
},
5052
"outputs": [],
5153
"source": [
5254
"%%time\n",
@@ -75,7 +77,9 @@
7577
{
7678
"cell_type": "code",
7779
"execution_count": null,
78-
"metadata": {},
80+
"metadata": {
81+
"collapsed": true
82+
},
7983
"outputs": [],
8084
"source": [
8185
"import os \n",
@@ -132,7 +136,9 @@
132136
{
133137
"cell_type": "code",
134138
"execution_count": null,
135-
"metadata": {},
139+
"metadata": {
140+
"collapsed": true
141+
},
136142
"outputs": [],
137143
"source": [
138144
"# The algorithm supports multiple network depth (number of layers). They are 18, 34, 50, 101, 152 and 200\n",
@@ -148,7 +154,7 @@
148154
"# batch size for training\n",
149155
"mini_batch_size = \"64\"\n",
150156
"# number of epochs\n",
151-
"epochs = \"20\"\n",
157+
"epochs = \"2\"\n",
152158
"# learning rate\n",
153159
"learning_rate = \"0.01\""
154160
]
@@ -165,6 +171,7 @@
165171
"cell_type": "code",
166172
"execution_count": null,
167173
"metadata": {
174+
"collapsed": true,
168175
"scrolled": true
169176
},
170177
"outputs": [],
@@ -246,7 +253,9 @@
246253
{
247254
"cell_type": "code",
248255
"execution_count": null,
249-
"metadata": {},
256+
"metadata": {
257+
"collapsed": true
258+
},
250259
"outputs": [],
251260
"source": [
252261
"# create the Amazon SageMaker training job\n",
@@ -273,7 +282,9 @@
273282
{
274283
"cell_type": "code",
275284
"execution_count": null,
276-
"metadata": {},
285+
"metadata": {
286+
"collapsed": true
287+
},
277288
"outputs": [],
278289
"source": [
279290
"training_info = sagemaker.describe_training_job(TrainingJobName=job_name)\n",
@@ -289,7 +300,7 @@
289300
"\n",
290301
"> `Training job ended with status: Completed`\n",
291302
"\n",
292-
"then that means training sucessfully completed and the output LDA model was stored in the output path specified by `training_params['OutputDataConfig']`.\n",
303+
"then that means training sucessfully completed and the output model was stored in the output path specified by `training_params['OutputDataConfig']`.\n",
293304
"\n",
294305
"You can also view information about and the status of a training job using the AWS SageMaker console. Just click on the \"Jobs\" tab."
295306
]
@@ -324,7 +335,9 @@
324335
{
325336
"cell_type": "code",
326337
"execution_count": null,
327-
"metadata": {},
338+
"metadata": {
339+
"collapsed": true
340+
},
328341
"outputs": [],
329342
"source": [
330343
"%%time\n",
@@ -370,7 +383,9 @@
370383
{
371384
"cell_type": "code",
372385
"execution_count": null,
373-
"metadata": {},
386+
"metadata": {
387+
"collapsed": true
388+
},
374389
"outputs": [],
375390
"source": [
376391
"from time import gmtime, strftime\n",
@@ -400,7 +415,9 @@
400415
{
401416
"cell_type": "code",
402417
"execution_count": null,
403-
"metadata": {},
418+
"metadata": {
419+
"collapsed": true
420+
},
404421
"outputs": [],
405422
"source": [
406423
"%%time\n",
@@ -428,7 +445,9 @@
428445
{
429446
"cell_type": "code",
430447
"execution_count": null,
431-
"metadata": {},
448+
"metadata": {
449+
"collapsed": true
450+
},
432451
"outputs": [],
433452
"source": [
434453
"# get the status of the endpoint\n",
@@ -474,7 +493,9 @@
474493
{
475494
"cell_type": "code",
476495
"execution_count": null,
477-
"metadata": {},
496+
"metadata": {
497+
"collapsed": true
498+
},
478499
"outputs": [],
479500
"source": [
480501
"import boto3\n",
@@ -491,7 +512,9 @@
491512
{
492513
"cell_type": "code",
493514
"execution_count": null,
494-
"metadata": {},
515+
"metadata": {
516+
"collapsed": true
517+
},
495518
"outputs": [],
496519
"source": [
497520
"!wget -O /tmp/test.jpg http://www.vision.caltech.edu/Image_Datasets/Caltech256/images/008.bathtub/008_0007.jpg\n",
@@ -504,7 +527,9 @@
504527
{
505528
"cell_type": "code",
506529
"execution_count": null,
507-
"metadata": {},
530+
"metadata": {
531+
"collapsed": true
532+
},
508533
"outputs": [],
509534
"source": [
510535
"import json\n",
@@ -538,7 +563,9 @@
538563
{
539564
"cell_type": "code",
540565
"execution_count": null,
541-
"metadata": {},
566+
"metadata": {
567+
"collapsed": true
568+
},
542569
"outputs": [],
543570
"source": [
544571
"#sage.delete_endpoint(EndpointName=endpoint_name)\n",
@@ -548,7 +575,9 @@
548575
{
549576
"cell_type": "code",
550577
"execution_count": null,
551-
"metadata": {},
578+
"metadata": {
579+
"collapsed": true
580+
},
552581
"outputs": [],
553582
"source": []
554583
}

introduction_to_amazon_algorithms/imageclassification_caltech/Image-classification-transfer-learning.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
"# batch size for training\n",
168168
"mini_batch_size = 128\n",
169169
"# number of epochs\n",
170-
"epochs = 10\n",
170+
"epochs = 2\n",
171171
"# learning rate\n",
172172
"learning_rate = 0.01\n",
173173
"top_k=2\n",
@@ -317,7 +317,7 @@
317317
"\n",
318318
"> `Training job ended with status: Completed`\n",
319319
"\n",
320-
"then that means training sucessfully completed and the output LDA model was stored in the output path specified by `training_params['OutputDataConfig']`.\n",
320+
"then that means training sucessfully completed and the output model was stored in the output path specified by `training_params['OutputDataConfig']`.\n",
321321
"\n",
322322
"You can also view information about and the status of a training job using the AWS SageMaker console. Just click on the \"Jobs\" tab."
323323
]

0 commit comments

Comments
 (0)