Skip to content

Commit

Permalink
Fix syntax + improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloha106 committed Sep 11, 2018
1 parent 326f713 commit 3919107
Showing 1 changed file with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Image classification training with image format demo\n",
"# Image classification training with image format\n",
"\n",
"1. [Introduction](#Introduction)\n",
"2. [Prerequisites and Preprocessing](#Prequisites-and-Preprocessing)\n",
Expand All @@ -15,7 +15,7 @@
" 2. [Training](#Training)\n",
"4. [Deploy The Model](#Deploy-the-model)\n",
" 1. [Create model](#Create-model)\n",
" 2. [Batch Transform](#Batch-transform)\n",
" 2. [Batch transform](#Batch-transform)\n",
" 3. [Realtime inference](#Realtime-inference)\n",
" 1. [Create endpoint configuration](#Create-endpoint-configuration) \n",
" 2. [Create endpoint](#Create-endpoint) \n",
Expand Down Expand Up @@ -346,7 +346,7 @@
" \"DataSource\": {\n",
" \"S3DataSource\": {\n",
" \"S3DataType\": \"S3Prefix\",\n",
" \"S3Uri\": s3train\n",
" \"S3Uri\": s3train,\n",
" \"S3DataDistributionType\": \"FullyReplicated\"\n",
" }\n",
" },\n",
Expand Down Expand Up @@ -455,16 +455,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set Up Hosting For The Model\n",
"## Deploy The Model\n",
"\n",
"A trained model does nothing on its own. We now want to use the model to perform inference. For this example, that means predicting the class label given an input image.\n",
"\n",
"This section involves several steps,\n",
"\n",
"1. [Create model](#CreateModel) - Create model for the training output\n",
"1. [Create endpoint configuration](#CreateEndpointConfiguration) - Create a configuration defining an endpoint.\n",
"1. [Create endpoint](#CreateEndpoint) - Use the configuration to create an inference endpoint.\n",
"1. [Perform inference](#Perform Inference) - Perform inference on some input data using the endpoint."
"1. [Batch Transform](#BatchTransform) - Create a transform job to perform batch inference.\n",
"1. [Host the model for realtime inference](#HostTheModel) - Create an inference endpoint and perform realtime inference."
]
},
{
Expand Down Expand Up @@ -524,7 +523,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"timestamp = time.strftime('-%Y-%m-%d-%H-%M-%S', time.gmtime())\n",
Expand Down Expand Up @@ -564,7 +565,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"sagemaker = boto3.client('sagemaker')\n",
Expand Down Expand Up @@ -620,14 +623,14 @@
" print(\"Result: label - \" + object_categories[index] + \", probability - \" + str(probability))\n",
" return object_categories[index], probability\n",
"\n",
"inpute_images = list_objects(s3_client, bucket, urlparse(batch_input).path.lstrip('/'))\n",
"print(\"Sample inputs: \" + str(input_images[:2]))\n",
"inputs = list_objects(s3_client, bucket, urlparse(batch_input).path.lstrip('/'))\n",
"print(\"Sample inputs: \" + str(inputs[:2]))\n",
"\n",
"outputs = list_objects(s3_client, bucket, batch_job_name + \"/output\")\n",
"print(\"Sample output: \" + str(outputs[:2]))\n",
"\n",
"# Check prediction result of the first 3 images\n",
"[get_label(s3_client, bucket, prefix) for prefix in outputs[0:3]]"
"# Check prediction result of the first 2 images\n",
"[get_label(s3_client, bucket, prefix) for prefix in outputs[0:2]]"
]
},
{
Expand Down Expand Up @@ -684,7 +687,7 @@
"metadata": {},
"source": [
"#### Create endpoint\n",
"Lastly, the customer creates the endpoint that serves up the model, through specifying the name and configuration defined above. The end result is an endpoint that can be validated and incorporated into production applications. This takes 9-11 minutes to complete."
"Next, the customer creates the endpoint that serves up the model, through specifying the name and configuration defined above. The end result is an endpoint that can be validated and incorporated into production applications. This takes 9-11 minutes to complete."
]
},
{
Expand Down Expand Up @@ -761,7 +764,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Perform inference\n",
"#### Perform inference\n",
"Finally, the customer can now validate the model for use. They can obtain the endpoint from the client library using the result from previous operations, and generate classifications from the trained model using that endpoint.\n"
]
},
Expand All @@ -781,7 +784,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Download test image"
"##### Download test image"
]
},
{
Expand Down

0 comments on commit 3919107

Please sign in to comment.