<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Vaibhav Malpani’s Blog - Medium]]></title>
        <description><![CDATA[Read all my blogs here - Medium]]></description>
        <link>https://medium.com/vaibhav-malpanis-blog?source=rss----eba21a89178c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Vaibhav Malpani’s Blog - Medium</title>
            <link>https://medium.com/vaibhav-malpanis-blog?source=rss----eba21a89178c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 26 May 2026 10:22:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/vaibhav-malpanis-blog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Keep your secrets to yourself | AWS Secret Manager]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/keep-your-secrets-to-yourself-aws-secret-manager-f33d627bb25f?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/f33d627bb25f</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[passwords]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws-secret-manager]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Mon, 06 Jun 2022 04:33:08 GMT</pubDate>
            <atom:updated>2022-06-06T04:33:07.937Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are building an application on AWS, you can use “AWS Secret Manager” to save information that you would need in your application. Like, Databases username-password, application details, client name, access tokens, etc.</p><p>Developers, end up saving these information on the server in a config file, which can be compromised if the config file is leaked. If the application is deployed on AWS lambda, it would be risky to save the information in the Environment variables.</p><p>If you want to run the same code on multiple environment, you can easily do that by just pointing the lambda to the correct secret in the environment variable.</p><h4>What is Secret Manager?</h4><p>Secret Manager is secure storage system sensitive data. Users and applications retrieve secrets with a call to Secrets Manager APIs, eliminating the need to hard-code sensitive information in plain text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*of792itql63NEYY3lt-egQ.jpeg" /></figure><p>Let’s build an application like i have mentioned above.</p><h4>Steps:</h4><ol><li>Create a secret in secret manager</li><li>Create a lambda function and connect it with secret manager</li><li>Add environment variable in lambda function</li></ol><h4>1. Create a secret:</h4><p>Go to <a href="https://us-east-1.console.aws.amazon.com/secretsmanager/home?region=us-east-1#!/listSecrets/">Secret Manager</a>, and click on “Store a new secret”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cCTaSBZPJjE0zuEcmmb1g.png" /></figure><p>There are various types of secrets you can store specifically for various AWS services like RDS, Document DB, or your own database on other cloud or on-premise.</p><p>In this example we will create a secret of type “Other”, where we can store any information in key-value pairs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q-GMDyAY8Zs4L7JuS_5dLQ.png" /></figure><p>You can then add values in the below text box like this. Below which you can select how you want your secret to be encrypted. You can use a key provided by AWS Secret Manager or create your own key. After selecting the key, click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t0hggMP18XYlF8SW31E2Ug.png" /></figure><p>On the next page, you can give the name to your secret. There is an option to replicate the secret in many regions. After which, click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2-6m4UjDCMCEfBqUpANng.png" /></figure><p>On the next page, you can set to rotate your secrets at a scheduled time. Although it is a optional field, it is best to have automatic rotations turned on. Rotation reduces the risk from leaving credentials unchanged for long periods of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*RaSpskPHizH3AWv_W7wBnw.png" /></figure><p>On the next page, you can review your secret, and click on “store”.</p><p>You have now created your secret. Let’s use this in a python code.</p><h4>Create a Lambda Function</h4><p>Create a Lambda function and add the below code</p><pre>import json<br>import boto3<br>import os</pre><pre>def lambda_handler(event, context):<br>    <br>    secret = boto3.client(&quot;secretsmanager&quot;, region_name=&#39;us-east-1&#39;)<br>    secret_value = secret.get_secret_value(SecretId=os.environ[&quot;client_env&quot;])<br>    secret_value = json.loads(secret_value[&quot;SecretString&quot;])<br>    print(secret_value)</pre><pre>return {<br>        &#39;statusCode&#39;: 200,<br>        &#39;body&#39;: json.dumps(&#39;Hello from Lambda!&#39;)<br>    }</pre><p>Here we are getting the value of secret from the environment variable. Check the below image to set the environment variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzShj1rWIPbeAu6JsCJfQQ.png" /></figure><p>The benefit of using the environment variable is, that we can just change the variable and run the same code on completely different environments.</p><h3>If you liked this post, please 👏👏for it on left, follow me if you want to read more such posts!</h3><h3>Twitter: <a href="https://twitter.com/IVaibhavMalpani">https://twitter.com/IVaibhavMalpani</a><br>LinkedIn: <a href="https://www.linkedin.com/in/ivaibhavmalpani/">https://www.linkedin.com/in/ivaibhavmalpani/</a></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f33d627bb25f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/keep-your-secrets-to-yourself-aws-secret-manager-f33d627bb25f">Keep your secrets to yourself | AWS Secret Manager</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AutoML using Amazon SageMaker Autopilot | Multiclass Classification]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/automl-using-amazon-sagemaker-autopilot-multiclass-classification-2e1237e2a6f9?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/2e1237e2a6f9</guid>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[autopilot]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Tue, 14 Jul 2020 14:55:02 GMT</pubDate>
            <atom:updated>2021-02-11T16:21:12.680Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS has always aimed at <strong>“Putting machine learning in the hands of every developer”. </strong>AWS launched Amazon Sagemaker in 2017 that helps developers build Machine Learning models with No prior knowledge. At re:invent 2019, AWS has launched a huge new feature to SageMaker called <strong>“SageMaker Studio”. </strong>It is an IDE for all your Machine Learning needs.</p><h4><strong>Introduction to SageMaker Studio:</strong></h4><p>It helps you <strong>Preprocess </strong>the data, <strong>Train </strong>your Machine Learning models using the best possible Algorithm by understanding your data, <strong>Deploy </strong>the model, <strong>Monitor </strong>the deployed model, and <strong>Debug </strong>the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*A8Jk4S1EAfIe3DHLR31zzA.png" /></figure><h3>SageMaker Autopilot</h3><p>SageMaker Autopilot automatically inspects raw data, applies <strong>feature processors</strong>, picks the best set of algorithms, trains and <strong>tunes multiple models</strong>, tracks their performance, and then <strong>ranks </strong>the models based on performance, all with just a few clicks.</p><p>SageMaker Autopilot can help you build a <strong>Classification </strong>and <strong>Regression </strong>Model on a <strong>Tabular </strong>data with no expertise about Machine Learning. It is quick to build your model and you can build it in a day compared to a Data Scientist who can take about a week or two.</p><h3><strong>Problem Statement:</strong></h3><p>We have a <a href="https://www.kaggle.com/amananandrai/ag-news-classification-dataset"><strong><em>dataset</em></strong></a> of news title and description which are classified into 4 categories consisting of 1-World, 2-Sports, 3-Business, 4-Sci/Tech. This will be a <strong>multiclass classification </strong>problem and we will try to solve it using SageMaker Autopilot. (I will be using a subset (20% of the complete dataset) to reduces the training time)</p><blockquote>Caution ⚠ : Autopilot is not included in free tier, so it will cost you for trying it out.</blockquote><h3>Steps to build using Autopilot</h3><ol><li>Upload data to an S3 bucket</li><li>Create an Experiment in SageMaker Studio</li></ol><ul><li>Preprocess Data</li><li>Create a Model</li><li>Deploy Model</li></ul><p>3. Test Deployed Model.</p><h4>Upload data to S3</h4><p>This is a very simple step. We will create a new bucket in S3 and make 2 folders as ‘input’ and ‘output’. We will then upload the training data in the input folder.</p><h4>Create an Experiment in SageMaker Studio</h4><p>If you have not created your SageMaker Studio, you can go <a href="https://console.aws.amazon.com/sagemaker/home?region=us-east-1#/studio/"><strong><em>here</em></strong></a><strong><em> </em></strong>and create it. After the studio is created, click on ‘open studio’.</p><p>On the left side, select the SageMaker Experiment list and select the create Experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*mgus9S6s1QCBtzph18X5ag.png" /></figure><p>After that, you will get a window in the middle of your screen. Enter your experiment name and enter the path to your dataset that is stored in S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*YQJtgqgwsiQNFCuTABuWxw.png" /></figure><p>Once you have selected your dataset. Enter the attribute name for which you want to do the predictions. In our case, it is <strong>‘class_index’. </strong>We will also need to give a path to store the output data. We will give our output folder as the output data location.</p><p>In our case, we know that it is going to be a Multiclass classification, but let’s just select <strong>Auto</strong>, and let’s see if it is able to understand that our problem type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*FZ4ImP_p84Q9ukdTn7jHKg.png" /></figure><p>After this, just hit <strong>‘Create Experiment’.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*df-1_frpUrq9973s-hn4zw.png" /></figure><p>We can now see that this pipeline has been created. Wait for it to complete. Once the Analyzing Data step is complete, you will see two new options at the top right corner: ‘Open candidate generation notebook’ and ‘Open data exploration notebook’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*SUgQZ8L8eAhKzD3-UBK2Eg.png" /></figure><p><strong>Candidate Generation Notebook: </strong>This will consist of a notebook that will have generated code for Data Transformation, SageMaker training job pipelines, Auto Hyperparameter tuning, and also the code to deploy the best model. (<em>Do open this file, It’s really interesting</em>)</p><p><strong>Data exploration notebook: </strong>Once you open this, you can see that it has all the details about our dataset. It has also understood that our dataset was for Multiclass classification and had 4 classes — 1, 2, 3, 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*aDiyGDRpypIuvKLBrMJWsA.png" /></figure><p>Once the pipeline is completed, you will see details about the jobs that have run and it’s accuracy shown as ‘Objective’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*89YjJG4Be8dwYvH8qdhO5Q.png" /></figure><p>Once you see this screen, select the best-performed job and click on the ‘Deploy model’. Enter an endpoint name and select an appropriate instance type depending on your expected usage. You can select to save the request and response data to the endpoint. After this, hit the “Deploy model’ button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*eiUaqh0fe_B4rJDDMAYYlQ.png" /></figure><p>On the left side, click on the SageMaker endpoint list as shown in the image below. First, you will see the status as ‘creating’. Wait for it to turn into ‘InService’. When it InService that means your model has been deployed and ready to be tested. You can deploy multiple models on multiple endpoints as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*brj_eGjVj1Esy9f2x-YwEw.png" /></figure><p>Test Deployed Model:</p><p>You can test your code on local using the below code.</p><pre>import boto3,sys</pre><pre>endpoint_name = &quot;&quot;</pre><pre>SageMaker_client = boto3.Session().client(&#39;runtime.sagemaker&#39;)</pre><pre>response = SageMaker_client.invoke_endpoint(EndpointName=endpoint_name, ContentType=&#39;text/csv&#39;, Body=&quot;Flintoff, Collingwood lead England to win, Andrew Flintoff hit a typically brutal 99 and took the final wicket Friday as England cruised to a comfortable series-clinching victory over India in the second one-day cricket international at the Oval.&quot;)<br>print(response[&#39;Body&#39;])</pre><p>And you should get the output as 2 for the above call as the news is related to Sports.</p><h3>What did we learn?</h3><ul><li>Building Machine Learning model on tabular data with no prior knowledge using SageMaker Autopilot.</li><li>Deploying models in a highly scalable environment.</li></ul><h3>If you liked this post, please 👏👏for it on left, follow me if you want to read more such posts!</h3><h4>Twitter: <a href="https://twitter.com/IVaibhavMalpani">https://twitter.com/IVaibhavMalpani</a><br>LinkedIn: <a href="https://www.linkedin.com/in/ivaibhavmalpani/">https://www.linkedin.com/in/ivaibhavmalpani/</a></h4><h3>Twitter: <a href="https://twitter.com/IVaibhavMalpani">https://twitter.com/IVaibhavMalpani</a><br>LinkedIn: <a href="https://www.linkedin.com/in/ivaibhavmalpani/">https://www.linkedin.com/in/ivaibhavmalpani/</a></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e1237e2a6f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/automl-using-amazon-sagemaker-autopilot-multiclass-classification-2e1237e2a6f9">AutoML using Amazon SageMaker Autopilot | Multiclass Classification</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy highly scalable Machine Learning model | Cloud Run]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/deploy-highly-scalable-machine-learning-model-cloud-run-2a60c69fb67f?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/2a60c69fb67f</guid>
            <category><![CDATA[google-cloud-run]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 05:31:01 GMT</pubDate>
            <atom:updated>2020-06-01T05:31:01.390Z</atom:updated>
            <content:encoded><![CDATA[<p>In recent times, Machine Learning applications are growing a lot. At the same time, people that access these applications are growing too. So to handle such dynamic load, you need to have servers that are secure, scalable, and reliable. <strong>Cloud Run </strong>provides this and many more functionalities.</p><h3>Objective:</h3><p>To deploy your Machine Learning/Deep Learning model which has the following capabilities:</p><ul><li>Automatic scaling up and down</li><li>Highly reliable and redundant</li><li>out-of-the-box stable HTTPS endpoint</li><li>Pay per use</li><li>Custom domain</li></ul><h3>Pre-requisites:</h3><ul><li>Basic understanding of Docker</li><li>Google Cloud Platform account.</li><li>A Machine Learning model already built and saved in a file.</li></ul><h4>Before we begin,</h4><p>Make sure you have a Machine Learning model that is saved in a file.</p><p>Also, you should have the code ready that takes the input parameter required by the model, read the model file in your code, give the input parameter to the model and the model returns back the output.</p><p>As there are 100’s of ways to read a model, give input to the model, and get a response from a model, I will show below a template of what your code should look like:</p><pre>def run_model(input):<br>    model = read_model(&#39;./model_file&#39;)<br>    result = model.get_result(input)<br>    return result</pre><h4>For this blog,</h4><p>I have decided to show a demo by using <strong>Python Flask Web Framework</strong> as python is mostly used for machine learning, it will be useful for a greater audience. But you can use any language that you want to write the above code.</p><p>Once you have written the above code, keep it in folder which contains the above code, your model, and requirements.txt</p><p>Now make a new file and name it Dockerfile. Below is the example that you can use if you are using python. (<em>Make sure the name of the file that you have written above is app.py to use the exact code. else you need to make changes in the last line of the code.</em>)</p><pre>FROM python:3.7</pre><pre># Copy local code to the container image.<br>ENV APP_HOME /app<br>WORKDIR $APP_HOME<br>COPY . .</pre><pre># Install production dependencies.<br>RUN pip install gunicorn<br>RUN pip install -r requirements.txt</pre><pre># Run the web service on container startup. Here we use the gunicorn<br># webserver, with one worker process and 8 threads.<br># For environments with multiple CPU cores, increase the number of workers<br># to be equal to the cores available.<br>CMD exec gunicorn — bind :$PORT — workers 1 — threads 8 app:app</pre><p>That’s it. That’s all the code we needed to write.</p><p>After this, set up a GCP project and download, install, and setup gcloud on your local machine. <a href="https://cloud.google.com/deployment-manager/docs/step-by-step-guide/installation-and-setup"><strong><em>here</em></strong></a></p><p>After that, just use the below-given commands.</p><ol><li><strong>Gcloud builds:</strong> This build an image of the code and model.</li></ol><pre>gcloud builds submit --tag gcr.io/<strong>PROJECT-ID</strong>/helloworld</pre><p><strong>2. Gcloud run deploy: </strong>This pushes the locally built image to google cloud container registry. It also deploys this image on cloud run that runs in a serverless manner.</p><pre>gcloud run deploy --image gcr.io/<strong>PROJECT-ID</strong>/helloworld --platform managed</pre><p>After this go to <a href="https://console.cloud.google.com/run">https://console.cloud.google.com/run</a></p><p>You can see, your image is deployed. Click on it to get more details. There on the top middle, you can see the URL at which your model is deployed. Try sending a request to this URL and see if you get the expected output. If not, try checking the logs that you can see just below the URL.</p><p>Well, that’s it. Your model is now running self-managed, highly scalable servers.</p><h3>If you liked this post, please clap for it; follow me if you want to read more such posts!</h3><h4>Twitter: <a href="https://twitter.com/IVaibhavMalpani">https://twitter.com/IVaibhavMalpani</a> <br>LinkedIn: <a href="https://www.linkedin.com/in/ivaibhavmalpani/">https://www.linkedin.com/in/ivaibhavmalpani/</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a60c69fb67f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/deploy-highly-scalable-machine-learning-model-cloud-run-2a60c69fb67f">Deploy highly scalable Machine Learning model | Cloud Run</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Face Recognition using Pytorch on Amazon Sagemaker]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/face-recognition-using-pytorch-on-amazon-sagemaker-c4f9f34c45f5?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/c4f9f34c45f5</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[face-recognition]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[sagemaker]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Wed, 20 May 2020 06:21:14 GMT</pubDate>
            <atom:updated>2020-06-30T05:12:42.246Z</atom:updated>
            <content:encoded><![CDATA[<h3>Face Recognition using Pytorch on Amazon Sagemaker (Jupyter notebook code included)</h3><p>Scientists all around the world have been working on face recognition using machine learning for more than a decade now. As a human, it’s easy for us to remember the face and the name of the person. But, it’s tough for a machine to remember this. With the growth of Neural Networks (NN) and many libraries making it easy to build a NN, this problem has become a bit easier. This blog will teach you everything that you need to know about building your own Face recognition ML model using the <a href="https://pytorch.org/"><strong><em>Pytorch library</em></strong></a>.</p><h4><strong>Applications of Face Recognition:</strong></h4><ul><li>Attendance system in schools, colleges.</li><li>Tracking in-time and out-time of office employees.</li><li>Security Video monitoring to detect an unidentified person in your premise</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39uwyBQnBh41kzu67m4X3A.jpeg" /></figure><h4><strong>Objective:</strong></h4><p>To build our own Face recognition model using CNN. We will use the Pytorch library to help us build CNNs. To train the model we would be using Amazon Sagemaker and save the trained model on S3.</p><h4>Pre-requisites:</h4><ul><li>Basic python programming knowledge</li><li>Understanding of how CNNs work (<a href="https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148"><strong><em>Read here</em></strong></a>)</li><li>An AWS account</li></ul><h3>Getting Data:</h3><p>To start off we will need a face dataset to train our model for face recognition. I have shared the dataset below to use for this tutorial. You can add your own images to the dataset. Train and Test them out on how the model works.</p><p>I have uploaded images for a few celebrities to train our model. I have very few images and still, it managed to get me over 90% accuracy. To get the best results out of a CNN model, just give it more data. :)</p><p>The GitHub link also contains the jupyter notebook for running the complete code. The notebook assumes that you have already done all the installing for torch and torchvision. For more details on how to install it locally on your machine → <a href="https://pytorch.org/get-started/locally/">click here</a></p><p><a href="https://github.com/vaibhav-malpani/pytorch-face-recognition"><strong>GitHub for Dataset and Jupyter Notebook</strong></a></p><blockquote>Please feel free to comment down below if you get stuck somewhere in the code. I will be more than happy to help you</blockquote><h3>Setting up SageMaker Instance:</h3><p>Training CNNs requires a lot of computing power. It’s best advised to use a machine with GPU to get results comparatively quickly. For this blog, we are going to use an <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/howitworks-create-ws.html"><strong>Amazon SageMaker Notebook instance</strong></a>. We are going to use the “<strong>ml.p2.xlarge</strong>” instance which has an NVIDIA Tesla K80 GPU. To use this you will need to increase your quota limit for your GPU. Read more about it <a href="https://forums.fast.ai/t/my-request-limit-is-set-to-0-for-all-gpu-instances-across-all-regions-in-aws/6963/6"><strong><em>here</em></strong></a> to know how to do it.</p><blockquote>I would recommend to use a instance with GPU, to get the results quickly</blockquote><p>Once the status of your SageMaker instance shows “inService”, Click on “Open Jupyter” to get started with your Jupyter notebook instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PNKpeb6f78-K8-ohOyXF3A.png" /></figure><p>Click on the top right corner and upload your data set and the Jupyter notebook that I have shared at the end of this blog. (<em>You will have to upload the dataset in zip format, as we cannot upload a folder to jupyter notebook. But don’t worry we have taken care of unzipping the data for you in the notebook code</em>)</p><h3>Building Models:</h3><p>I will explain a few snippets from the jupyter notebook provided earlier. You can go through the notebook to understand the rest of it which is quite straightforward.</p><pre>from torchvision import models<br>model = models.alexnet(pretrained=True)</pre><p>You can see that we are using a pre-trained Model (alexnet). torchvision provides a lot of pre-trained models that have been trained on millions of images. By using this, we just edit the top layer of the model architecture by editing the out_features of the existing model.</p><pre>AlexNet(<br>  (features): Sequential(<br>    (0): Conv2d(3, 64, kernel_size=(11, 11), stride=(4, 4), padding=(2, 2))<br>    (1): ReLU(inplace=True)<br>    (2): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)<br>    (3): Conv2d(64, 192, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))<br>    (4): ReLU(inplace=True)<br>    (5): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)<br>    (6): Conv2d(192, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))<br>    (7): ReLU(inplace=True)<br>    (8): Conv2d(384, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))<br>    (9): ReLU(inplace=True)<br>    (10): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))<br>    (11): ReLU(inplace=True)<br>    (12): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)<br>  )<br>  (avgpool): AdaptiveAvgPool2d(output_size=(6, 6))<br>  (classifier): Sequential(<br>    (0): Dropout(p=0.5, inplace=False)<br>    (1): Linear(in_features=9216, out_features=4096, bias=True)<br>    (2): ReLU(inplace=True)<br>    (3): Dropout(p=0.5, inplace=False)<br>    (4): Linear(in_features=4096, out_features=4096, bias=True)<br>    (5): ReLU(inplace=True)<br>    (6): Linear(in_features=4096, <strong>out_features=1000</strong>, bias=True)<br>  )<br>)</pre><p>As you can see in the above example the “out_feautres” is 1000, but in our dataset, we want to classify into 6 classes (ben_afflek, brad_pitt, elton_john, jerry_seinfeld, madonna, mindy_kaling)</p><p>So to edit the final layer, we have used the below code.</p><pre>class_names = train_data.classes<br>model.classifier[6] = nn.Linear(num_ftrs, len(class_names))</pre><p>So after this, our model architecture looks like this:</p><pre>AlexNet(<br>  (features): Sequential(<br>    (0): Conv2d(3, 64, kernel_size=(11, 11), stride=(4, 4), padding=(2, 2))<br>    (1): ReLU(inplace=True)<br>    (2): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)<br>    (3): Conv2d(64, 192, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))<br>    (4): ReLU(inplace=True)<br>    (5): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)<br>    (6): Conv2d(192, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))<br>    (7): ReLU(inplace=True)<br>    (8): Conv2d(384, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))<br>    (9): ReLU(inplace=True)<br>    (10): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))<br>    (11): ReLU(inplace=True)<br>    (12): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)<br>  )<br>  (avgpool): AdaptiveAvgPool2d(output_size=(6, 6))<br>  (classifier): Sequential(<br>    (0): Dropout(p=0.5, inplace=False)<br>    (1): Linear(in_features=9216, out_features=4096, bias=True)<br>    (2): ReLU(inplace=True)<br>    (3): Dropout(p=0.5, inplace=False)<br>    (4): Linear(in_features=4096, out_features=4096, bias=True)<br>    (5): ReLU(inplace=True)<br>    (6): Linear(in_features=4096, <strong>out_features=6</strong>, bias=True)<br>  )<br>)</pre><p>After the model architecture is designed as we needed to, we need to decide on our loss function and optimizer. In my experience, the below-given loss function and optimizer work well for face recognition.</p><pre>criterion   = nn.CrossEntropyLoss()<br>optimizer   = torch.optim.SGD(model.parameters(), lr=0.001, momentum=0.9)</pre><p>Now that we have our model, loss function, and optimizer, we can pass this to our “train_model” function. It also takes num_epochs as one of the parameters. To get the best output, keep it 500.</p><p>train_model function prints the accuracy of the model in the training and testing phase. At the end of the training, returns the model with the best accuracy during the testing phase.</p><p>Once you get the best model after training, you can use the below-given code to test your model. This snippet takes a folder with just images in it as input and outputs the name of the person in the images. Of course, it only understands the faces on which we had trained earlier.</p><pre>import glob<br>from PIL import Image<br>from torch.autograd import Variable<br>from os import listdir<br>with torch.no_grad():</pre><pre>base_path = &quot;./face_test/&quot;<br>correct = 0<br>total = 0<br>array = [&#39;ben_afflek&#39;, &#39;brad_pitt&#39; ,&#39;elton_john&#39;, &#39;jerry_seinfeld&#39;, &#39;madonna&#39;, &#39;mindy_kaling&#39;]<br>test_transform = transforms.Compose([transforms.Resize(256),transforms.CenterCrop(224),transforms.ToTensor(),transforms.Normalize(mean=mean,std=std)])<br>onlyfiles = [f for f in listdir(base_path)]<br>print(onlyfiles)<br>for files in onlyfiles:<br>images=glob.glob(base_path + files)<br>for image in images:<br>img = Image.open(image)<br>trans = transforms.ToPILImage()<br>trans1 = transforms.ToTensor()<br>transformed_image = test_transform(img).float()<br>transformed_image = Variable(transformed_image, requires_grad=True)<br>transformed_image = transformed_image.unsqueeze(0)<br>transformed_image = transformed_image.to(device)<br>outputs = model(transformed_image)<br>_, predicted = torch.max(outputs.data, 1)<br>predicted_index_value = predicted.cpu().numpy()[0]+array[predicted_index_value])<br>imshow(trans1(img),array[predicted_index_value])</pre><p>You can keep iterating with training and testing, till you get a model that you feel comfortable with.</p><p>Since you have trained this on a Sagemaker notebook instance, you need to save it S3, so that you can reuse this model again.</p><p>Below given code saves the model on the Sagemaker instance and uploads it to S3.</p><pre>torch.save(model, &#39;./model_final&#39;)</pre><pre><br>import boto3<br>file_name = &#39;./model_final&#39;<br>s3 = boto3.resource(&#39;s3&#39;)<br>bucket=&#39;my_bucket_name&#39; # Replace with your s3 bucket name<br>s3.meta.client.upload_file(file_name, bucket, &#39;final_pytorch_model&#39;)</pre><p>To load back the saved model you can just run all the necessary imports for the torch library and use the below code to load the model. (<em>complete code included in the Jupyter notebook</em>)</p><pre>model = torch.load(&#39;./saved_model&#39;)<br>model.eval()</pre><h3><strong>What did we learn?</strong></h3><ul><li>how to build a CNN model using Pytorch Library</li><li>How to spin up a SageMaker Notebook Instance to build the CNN model quickly without the need to buy expensive GPUs.</li><li>Saving the trained model onto S3</li></ul><h4>In the next blog, we will learn how to deploy any Machine Learning model on AWS to get the best scalability and reliability.</h4><h3>If you liked this post, please clap for it; follow me if you want to read more such posts!</h3><h4>Twitter: <a href="https://twitter.com/IVaibhavMalpani">https://twitter.com/IVaibhavMalpani</a> <br>LinkedIn: <a href="https://www.linkedin.com/in/ivaibhavmalpani/">https://www.linkedin.com/in/ivaibhavmalpani/</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4f9f34c45f5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/face-recognition-using-pytorch-on-amazon-sagemaker-c4f9f34c45f5">Face Recognition using Pytorch on Amazon Sagemaker</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Deepracer (2020 edition)]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/getting-started-with-deepracer-2020-edition-a7896dd07c48?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/a7896dd07c48</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deepracer]]></category>
            <category><![CDATA[reinvent]]></category>
            <category><![CDATA[2020]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Thu, 30 Jan 2020 14:04:24 GMT</pubDate>
            <atom:updated>2020-01-29T15:00:28.835Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting Started with AWS Deepracer (2020 edition)</h3><p>Since the last time, I wrote a blog on <a href="https://medium.com/vaibhav-malpanis-blog/how-to-win-at-deepracer-league-code-and-model-included-27742b868794"><strong><em>how to win at Deepracer?</em></strong></a><em> </em>a LOT has changed on the Deepracer Console. You could read that to know the very basics of Deepracer and Reinforcement Learning. This blog will guide you to build your model on the new Deepracer Console. This can help you get ready for the Deepracer leagues at your nearest summits <a href="https://aws.amazon.com/events/summits/?trk=ep_card_event_page&amp;global-event-sponsorship.sort-by=item.additionalFields.sortdate&amp;global-event-sponsorship.sort-order=asc"><em>(for more details)</em></a><em> </em>and also for Virtual circuits that take place throughout the year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*70d1mypOZTlJ0xsF.jpg" /><figcaption>AWS Deepracer Evo, 2020.</figcaption></figure><p><strong><em>This blog is divided into 3 parts:</em></strong></p><ol><li><strong><em>Steps on how to build the model for Deepracer</em></strong></li><li><strong><em>Pricing for Deepracer</em></strong></li><li><strong><em>Key Takeaways</em></strong></li></ol><h3>Steps to build your Deepracer Model:</h3><ol><li>Setup account resources</li><li>Build your vehicle in Garage</li><li>Create a Model</li><li>Evaluate your Model</li></ol><h4>1. Setup account resources:</h4><ul><li>Navigate <a href="https://console.aws.amazon.com/deepracer/home?region=us-east-1#getStarted">here</a> to get started</li><li>Look of <strong>Step 0: Create account resources</strong></li><li>Just click on <strong>Create Resource </strong>there.</li></ul><h4>2. Build your vehicle in Garage:</h4><p>Before you hop on to start building your model, it’s good to configure your vehicle in your garage.</p><ul><li>Navigate to garage <a href="https://console.aws.amazon.com/deepracer/home?region=us-east-1#garage"><strong>here</strong></a></li><li>Click <strong>Build New Vehicle </strong>at the top right corner</li><li>The first thing you see here is to set up an extra camera or sensor if you have one, else stick to the just front camera. This also gives you option to add the LIDAR sensor for object detection and avoid it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tv6fFfgNyKOV51Sxd7DZeg.png" /><figcaption>Mod specification</figcaption></figure><ul><li>Next, you could see <strong>Neural Network Topologies, </strong>which now lets you select the CNN layer depending upon the task you want to do out of your Deepracer.</li><li><strong>3 Layer CNN:</strong> A shallower network of fewer layers trains much faster than a deeper network of more layers. It is ideal for training models that are built with less complex tasks to master.</li><li><strong>5 Layer CNN:</strong> A deeper neural network, with more layers, will take longer to train but will be able to handle more complex tasks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYEnIQ4ZOHvw0YjJiqR7yw.png" /></figure><ul><li>Next is setting up <strong>Action Space,</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYr6LBQfJoJAskdIjfjVeg.png" /></figure><ul><li><strong>Maximum steering angle: </strong>This is the maximum angle you want the Deepracer to turn.</li><li><strong>Steering angle granularity: </strong>This is how fine you want to divide the steering angle. In the above case, the Steering angle is divided as (-30, -15, 0, 15, 30)</li><li><strong>Maximum Speed: </strong>This is the maximum speed you want your Deepracer to go at any given angle.</li><li><strong>Speed Granularity: </strong>This is how fine you want to divide your Max speed.</li><li>On the basis of all the above-mentioned values, the below-shown table is formed. Which gives your Deepracer, choices to choose from while performing an action.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SzlUbCpFenCcHeHmukab6w.png" /></figure><ul><li>Another new addition in Deepracer 2020, was giving developers to change the Visual appearance of your Deepracer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YKbT7kA1IOft9ecb7UmaZg.png" /></figure><ul><li>Just click Done at the end and you have built your Customized Deepracer Car, Parked in your Garage :)</li></ul><h4>3. Create a Model:</h4><ul><li>To start with creating model, Navigate <a href="https://console.aws.amazon.com/deepracer/home?region=us-east-1#createModel"><strong>here</strong></a></li><li>Enter a model name</li><li>Select a track on which you wish to train your Deepracer</li><li>Select Next</li><li>Choose the race type here and the car to be used from your Garage</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y5dDYdyqKLpP8RUsHEwlEg.png" /></figure><ul><li>Next, You have to give a reward function. Refer <a href="https://docs.aws.amazon.com/deepracer/latest/developerguide/deepracer-reward-function-input.html"><strong>THIS</strong></a><strong> </strong>to get started with writing your Reward Function.</li></ul><blockquote>What is a reward function? — It is you giving points for good action taken by the Deepracer and reducing points for taking an incorrect action.</blockquote><ul><li>Give your hyperparameters. (If this is your first model, don’t worry about this, just let this be set to defaults). Click <a href="https://docs.aws.amazon.com/deepracer/latest/developerguide/deepracer-console-train-evaluate-models.html#deepracer-iteratively-adjust-hyperparameters"><strong><em>here</em></strong></a> for more details on Hyperparameters.</li><li>Select your stop condition, meaning asking the Deepracer console to train the Deepracer for a given amount of time. Train for at least 250 minutes to get a decent running model.</li></ul><h4>4. Evaluate the Model:</h4><ul><li>Navigate <a href="https://console.aws.amazon.com/deepracer/home?region=us-east-1#models"><strong>here</strong></a><strong> </strong>to look at a list of all models.</li><li>Click on your model name</li><li>There you could see your Training Progress.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*Rob2KPETvRhrowFpF6_JVw.png" /></figure><ul><li>Below this, you could see <strong>Start new evaluation.</strong></li><li>On clicking this, Select the track on which you want to test your model. (Yes, you can evaluate on a different track than the one you have trained it on)</li><li>Choose the number of trials to evaluate your model. It’s good to choose 5 trails. ;)</li><li>Choose the Race Type that you want to evaluate.</li><li>Click on <strong>Start evaluation.</strong></li></ul><h3>Pricing:</h3><ul><li>AWS DeepRacer provides a Free Tier, that covers the first 7 hours of training.</li><li>After this, it cost around 4 to 5 dollars an hour to train and evaluate your model. checkout <a href="https://aws.amazon.com/deepracer/pricing/"><strong><em>here</em></strong></a> for more information about the pricing.</li></ul><h3>Key Takeaways:</h3><ol><li>You should be careful while choosing the <strong>training time </strong>of your model. If you train it too much it will overfit the track and won’t be able to perform with slight changes in the environment, whereas on the other hand if your train it less, the model won’t be strong enough to make correct decisions.</li><li>Your primary focus while building and training the model on the virtual environment should be on the <strong>accuracy and reliability</strong> of your model and not the speed or lap time of your DeepRacer. As in the Physical racing league, you will be able to accelerate your DeepRacer using their app on the phone.</li></ol><h3>Best of luck for 2020. I hope you win and get a chance to participate in the Grand Deepracer League at re:Invent 2020.</h3><h3>If you liked this post, please clap for it; follow me if you want more such posts!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*IQKDeamX4YiAerEo.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7896dd07c48" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/getting-started-with-deepracer-2020-edition-a7896dd07c48">Getting Started with Deepracer (2020 edition)</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Deepracer Roadmap for 2020]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/aws-deepracer-roadmap-for-2020-b0d901679395?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/b0d901679395</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[2020]]></category>
            <category><![CDATA[deepracer]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Thu, 30 Jan 2020 04:46:01 GMT</pubDate>
            <atom:updated>2020-01-30T13:58:12.423Z</atom:updated>
            <content:encoded><![CDATA[<h3>In 2018…</h3><p>AWS Launched the Deepracer at re:Invent 2018. Since then buzz around the autonomous car is been growing rapidly.</p><h3>In 2019…</h3><p>AWS hosted the “Deepracer League” in 22 cities all around the globe. Participants could also race in the virtual league that was held every month <a href="https://aws.amazon.com/deepracer/schedule-and-standings/"><em>(for more details)</em></a>. Winners at each summit and at each virtual circuit got an expense paid trip to Las Vegas and participate in AWS Deepracer League at re:Invent 2019.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15rFZ2X8yNMWi75svAGOdw.jpeg" /><figcaption>AWS Deepracer League,2019</figcaption></figure><h3>In 2020…</h3><p>AWS plans to host the official “Deepracer League” in 30 cities this time. Even if there is no “Official Deepracer League”<strong>[1]</strong> in your city, most likely you would be having a Deepracer league at your nearest summit <a href="https://aws.amazon.com/events/summits/?trk=ep_card_event_page&amp;global-event-sponsorship.sort-by=item.additionalFields.sortdate&amp;global-event-sponsorship.sort-order=asc"><em>(for more details)</em></a><em>. </em>You can attend these summits and race. If you looking for a way to attend re:Invent 2020, you can participate and win in the 24 ‘virtual circuits’ races that you can join from anywhere in the world.</p><h3>What has changed since Inception?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/0*6Vug0o15-Kb5GAra.png" /><figcaption>AWS Deepracer</figcaption></figure><p>Deepracer started with the basic idea of developers learning about Reinforcement Learning (RL) with the fun of racing against someone. This idea has helped a lot of developers around the world with no Machine Learning (ML) background to get started with RL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/0*4S7rz5996FfJYCvB.png" /><figcaption>AWS Deepracer Evo</figcaption></figure><p>The Idea of just racing against time on a plane race track was good, but now it’s growing in 2020. With the introduction of <strong>AWS Deepracer Evo</strong> AWS will add <a href="https://en.wikipedia.org/wiki/Lidar">Light Detection and Ranging</a> (<strong>LIDAR</strong>) sensor which can help detect and avoid any obstacle. This year AWS also plans to introduce <strong>head-to-head</strong> racing, which means racing against another Deepracer that is on the same track.</p><h3>So what can you do??</h3><ul><li>Learn how to build your model on AWS. (you can refer to <strong><em>“</em></strong><a href="https://medium.com/@IVaibhavMalpani/getting-started-with-deepracer-2020-edition-a7896dd07c48"><strong><em>Getting Started with Deepracer (2020 edition)</em></strong></a><strong><em>”</em></strong> for a step-by-step tutorial.</li><li>Participate in AWS Deepracer League at your nearest summit</li><li>Participate in Virtual Circuits from anywhere in the world</li></ul><h3>How will it help you?</h3><ul><li>It can get you on-boarded onto AWS if you’re not familiar with it.</li><li>Get an expense paid trip to Las Vegas and participate in Deepracer League at re:Invent 2020 <em>(If you win at any official summit).</em></li><li>It will get you started with Machine Learning.</li><li>You get to meet amazing community members with the same passion for ML and racing.</li></ul><blockquote>Get more help form Deepracer Global Community — <a href="http://join.deepracing.io/"><strong>here</strong></a></blockquote><blockquote>Watch Video’s from Deepracer Experts Bootcamp <a href="https://www.youtube.com/channel/UCgKGzMFBUULYLMT6_vv2T5g/videos"><strong>— here</strong></a><strong>.</strong></blockquote><p><strong>[1] </strong>Official Deepracer Leagues are the ones that AWS announces of their website and considers these race winners for the re:Invent.</p><h3>If you liked this post, please clap for it; follow me if you want more such posts!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*hYdr5I1cbtCsk1aS.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0d901679395" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/aws-deepracer-roadmap-for-2020-b0d901679395">AWS Deepracer Roadmap for 2020</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build your custom Search Engine using Machine Learning | AWS Kendra]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/build-your-custom-search-engine-using-machine-learning-amazon-kendra-d7832411c6ad?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/d7832411c6ad</guid>
            <category><![CDATA[kendra]]></category>
            <category><![CDATA[search-engines]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Mon, 06 Jan 2020 04:31:01 GMT</pubDate>
            <atom:updated>2020-05-12T05:08:30.467Z</atom:updated>
            <content:encoded><![CDATA[<h3>Amazon Kendra | Build your custom Search Engine using Machine Learning</h3><p>In an enterprise, you would have a lot of files that have a lot of information in various formats like <strong>‘PPT’, ‘PDF’, ‘TXT’</strong> etc. but it’s just very hard to find it quickly when it’s most needed. Let’s say even if find the file, you will need to browse through a lot of pages to exactly find what you were looking for. Also looking for files in folders and browsing through it is not as natural as talking, right? (This will make sense as we move along)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Odjg2p5Gtgd9vbPvJ4kuZg.gif" /><figcaption>One who is trying to find data from a chunk of files</figcaption></figure><blockquote>Today we will learn how to extract information by naturally talking to a chunk of files</blockquote><h4>To get started:</h4><ol><li>A lot of files (If you are an enterprise, you already have it :D )</li><li>AWS account for using Amazon Kendra</li></ol><p>For this demo, I did not have enough files so I created them. I took a lot of random words and extracted the data related to it from Wikipedia and saved them in separate text files using the below-shown code (will only work on python 3)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4ccf5a31f39d2ca10d410e0e26e15d9/href">https://medium.com/media/c4ccf5a31f39d2ca10d410e0e26e15d9/href</a></iframe><h4>Problem statement</h4><p>We will consider the above-extracted files as our chunk of files and try to make a search engine over these files using <strong>Amazon Kendra. </strong>It’s a highly accurate and easy to use enterprise search service that’s powered by machine learning.</p><p><strong>Steps:</strong></p><ol><li><strong>Create Index</strong></li><li><strong>Add Data Sources</strong></li><li><strong>Test and Deploy</strong></li></ol><h4>1. Create Index:</h4><ul><li>Give any index name that would help you recognize what data is present in that index.</li><li>In IAM Role, you can select an existing role or choose ‘create a new role’</li><li>Encryption of data can vary for everyone, in this case, I am not selecting the encryption option.</li><li>click on create after you are done with the above steps. It can take up to 30 minutes to create the index.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*9ayf4lpiXPqD74R3viaiVA.png" /><figcaption>Screenshot for ‘create index‘</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZVUjnGh_JkTC3vrEo7Km4Q.png" /><figcaption>After the Index is created</figcaption></figure><h4><strong>2. Add Data Sources:</strong></h4><p>Data could be imported from the <em>S3 bucket, SharePoint and Amazon RDS. </em>For our demo, I have uploaded the wiki files on a S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*42Do3iQl4pYl46CEXK4Psg.png" /><figcaption>Data source connectors</figcaption></figure><ul><li>Click on ‘Add connector’ below the S3 bucket</li><li>Give a name to your data source</li><li>On the next screen ‘browse S3’ bucket and select the bucket which has your data files.</li><li>We will select ‘sync run schedule’ frequency as ‘on-demand’ for our demo. You could choose appropriately depending upon your use-case.</li><li>And at the end select ‘create’</li><li>After that, the below window will show up. Click on ‘Sync now’ to start the data syncing from S3 to Amazon Kendra.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*Ydt1VnFpJ0uafRoBgSKC1g.png" /></figure><h4><strong>3. Test and Deploy:</strong></h4><p>Click on ‘Search Console’ on the below-shown dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*Qn8Ekv3KtfPDr5zJotiyNA.png" /></figure><p>We can start with simple searches like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*PUQa1xdnltbO80q6GwN-ZA.png" /></figure><p>As you can see it can easily find files that have apple word in it.</p><p>Let’s see how the search reacts when we give it complex queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*tCsiRWiGulUcA6UVRbd2dw.png" /><figcaption>notice how the $265 billion is shown in a larger font</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*tMDVBmOrp0wL0THDKKLjoQ.png" /></figure><p>As you can see from the above result, Amazon Kendra understands natural language questions and gives the answer which is easy-to-understand.</p><h3>Pricing:</h3><h4>Free tier:</h4><p>The service provides free usage of up to 30 days of the Developer Edition (coming soon) from the time you create your first index.</p><h4>Pricing table:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z0n7TIh2NwqB4qaQEXrXHw.png" /><figcaption><a href="https://aws.amazon.com/kendra/pricing/">https://aws.amazon.com/kendra/pricing/</a></figcaption></figure><h3>Customer story:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*HFhRuLP3HQ64-JKkiyycPw.png" /></figure><p>When Material scientists at 3M lead new research, they need access to information from prior relevant research information that’s buried in the many patents they hold in their huge knowledge base. Finding the right information is often exhausting (but not exhaustive) and time-consuming. To deal with this issue, they decided to use Amazon Kendra.</p><h3>If you liked this post, please clap for it; follow me if you want more such posts!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*3mMh5ne9EU1SPr2tQefyGQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7832411c6ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/build-your-custom-search-engine-using-machine-learning-amazon-kendra-d7832411c6ad">Build your custom Search Engine using Machine Learning | AWS Kendra</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grow your business by forecasting its future using AWS Forecast]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/grow-your-business-by-forecasting-its-future-amazon-forecast-718e7ec579d?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/718e7ec579d</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[forecast]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Sun, 29 Sep 2019 03:37:14 GMT</pubDate>
            <atom:updated>2020-06-23T19:26:05.662Z</atom:updated>
            <content:encoded><![CDATA[<h3>Grow your business by forecasting its future | Amazon Forecast with example/tutorial</h3><pre>Want to predict your upcoming sales revenue??</pre><pre>Want to know appropriate inventory levels of a particular item to stock??</pre><pre>Want to predict the right level of available resources, such as staffing levels, raw material etc. to maximize revenue and control costs??</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ff_WMTFgFsXs0Gp1Mq4KBw.png" /></figure><p>To run a successful business, you should be ready for the future. No matter the scale of the business, you should be ready for any circumstance. Almost all companies have been facing the problem of predicting its sales revenue, inventory management, workforce and resource management, financial planning, supply chain, healthcare, etc.</p><p>Before machine learning, people could only predict based on their experiences. But obviously, that cannot be precise. Since all the companies have been storing all these transactions (sales figures, inventory data) for a long time, this can be used to <strong>forecast the future using machine learning.</strong></p><blockquote>A good forecaster is not smarter than everyone else. He merely has his ignorance better organized.</blockquote><h3>Amazon Forecast:</h3><p>Amazon Forecast is a fully managed service that uses machine learning to deliver highly accurate forecasts. It can achieve forecasting accuracy levels that used to take months of engineering in as little as a few hours with no machine learning experience to get started.</p><blockquote>Amazon Forecast has helped succeed customers like CasaOne, CJ Logistics, OMOTOR, etc. <a href="https://aws.amazon.com/forecast/customers/">https://aws.amazon.com/forecast/customers/</a></blockquote><h3>Steps:</h3><ol><li>Create Dataset and Import data</li><li>Train a Predictor</li><li>Generate Forecasts</li></ol><h4>Problem Statement (<a href="https://drive.google.com/open?id=1vel5vEv12hW5QM8SMiThbFPKoAbpNL7F">Download Dataset</a>):</h4><p>Predicting the sales of an item for the next 10 days based on past sales records for 30 months.</p><h3>Create Dataset and Import data:</h3><p>To Start Forecasting your data, Upload it to an <a href="https://docs.aws.amazon.com/AmazonS3/latest/user-guide/upload-objects.html"><strong>S3 Bucket</strong></a>.</p><p>Open <a href="https://console.aws.amazon.com/forecast/home?region=us-east-1"><strong>Amazon Forecast console</strong></a> and select “Create Dataset Group”.</p><p>To create a dataset group, there are 3 more steps:</p><ol><li>Create Dataset Group</li><li>Create Target Time Series Dataset</li><li>Import Target Time Series Data</li></ol><h4>Create Dataset Group:</h4><p>You can give any Dataset Group Name and since our dataset is of forecasting retail we have selected Domain as “Retail”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*T0zQWSxDGPxfySrGi_sdhw.png" /></figure><p>Amazon Forecast supports the following dataset domains:</p><ul><li><a href="https://docs.aws.amazon.com/forecast/latest/dg/retail-domain.html">RETAIL Domain</a> — For retail demand forecasting</li><li><a href="https://docs.aws.amazon.com/forecast/latest/dg/inv-planning-domain.html">INVENTORY_PLANNING Domain</a> — For supply chain and inventory planning</li><li><a href="https://docs.aws.amazon.com/forecast/latest/dg/ec2-capacity-domain.html">EC2 CAPACITY Domain</a> — For forecasting Amazon Elastic Compute Cloud (Amazon EC2) capacity</li><li><a href="https://docs.aws.amazon.com/forecast/latest/dg/workforce-domain.html">WORK_FORCE Domain</a> — For workforce planning</li><li><a href="https://docs.aws.amazon.com/forecast/latest/dg/webtraffic-domain.html">WEB_TRAFFIC Domain</a> — For estimating future web traffic</li><li><a href="https://docs.aws.amazon.com/forecast/latest/dg/metrics-domain.html">METRICS Domain</a> — For forecasting metrics, such as revenue and cash flow</li><li><a href="https://docs.aws.amazon.com/forecast/latest/dg/custom-domain.html">CUSTOM Domain</a> — For all other types of time-series forecasting</li></ul><h4>Create Target Time Series Dataset:</h4><p>In this step, you have to describe the Data scheme and the Frequency of your data needs to be given to Amazon Forecast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*HxGfagvGpJOp0f11pnzeEQ.png" /></figure><h4>Import Target Time Series Data:</h4><p>In this step, Give the timestamp format of your dataset. It has to be a form of “yyyy-MM-dd” or “yyyy-MM-dd HH:mm:ss”.</p><p>You can create a new IAM role or select an existing role.</p><p>In the Data Location field, enter the path of your dataset present in S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*XW4MCKIUNBQ1wX3vA2_2Iw.png" /></figure><p>To complete your first step, click on “Start Import” and wait for the import to complete.</p><h3>Train a Predictor:</h3><p>After the import is done, you would see a screen as shown below. Click on the “Start” button beside “Predictor Training”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*AqJFbioVP_GBSdGEGBa8Kw.png" /></figure><p>In this step, we will forecast for the next 10 days. So we’ve set the Forecast horizon as 10. For the “Algorithm Selection” you can select a manual algorithm or select “AutoML”. The rest of the things can be kept as default and click “Train Predictor”.</p><p>Amazon Forecast will now start to train the forecasting model by understanding the data and forming an algorithm that fits best for the provided dataset. It might take around 10–20 minutes depending on the size of your dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*JfjomGjqHuAuMpg2PlBOvw.png" /></figure><h3>Generate Forecasts:</h3><p>After training your dataset, It’s finally time to generate the forecast and have a look into the future!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*79SgZBhVXO7l6nzq5rmheg.png" /></figure><p>After the training, you would see the above screen. Click on the “Start” button right next to “Forecast Generation”.</p><p>Here you can enter any name for your forecast and select the Training model that we have just trained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*DjLCbgSe42NOUl2bvlQ5Hg.png" /></figure><p>Once that is done. It’s time to now forecast sales.</p><p>Click on “Lookup Forecast” as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*bUapDWkcRcviTJk8ypPWMQ.png" /></figure><p>Here you would be asked for the select your forecaster. Select a start date and end date. Remember, That the difference between the start and end date should not be greater than the “Forecast Horizon” that you had mentioned while training your model.</p><p>Since in our data we had only one item. We had to put the item_id as 1. Now hit “Get Forecast” and scroll down to see the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*ctjZv-2Q8AFLKtsZIye6wQ.png" /></figure><p>You would see something the result as mentioned below. The results have Time on the X-axis and the expected sales on the Y-axis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*-2KHqVwyn5oMEfx1fiLO_w.png" /></figure><p>The result does look confusing as to what is P10, P50 and P90 forecasts. These are the <em>Prediction quantiles. </em>By calculating prediction quantiles, the model shows how much uncertainty is associated with each forecast.</p><p>For the <strong>P10 prediction</strong>, the true value is expected to be lower than the predicted value, 10% of the time. For the <strong>P50 prediction</strong>, the true value is expected to be lower than the predicted value, 50% of the time. For the <strong>P90 prediction</strong>, the true value is expected to be lower than the predicted value, 90% of the time.</p><p>If you think you might face a problem of storage space or cost of investment if you overstock the item, you might wanna choose the <strong>P10 forecast</strong>. as you will be overstock for only 10% of the time else you would be sold out every day.</p><p>But on the other hand, the cost of not selling the item is extremely high or the cost of invested capital is low or it would result in huge amounts of lost revenue you might wanna choose the <strong>P90 forecast</strong>.</p><h3>Summary:</h3><p>We have imported the data to an S3 bucket and uploaded them to the Forecast dataset. Trained the model using the AutoML predictor and used that to generate a forecast. You have successfully built your first “Time Series Forecasting” model, using Amazon Forecast.</p><h4>If you face any problem, please feel free to comment below. Amazon Forecast also has great documentation: <a href="https://docs.aws.amazon.com/forecast/latest/dg/how-it-works.html">https://docs.aws.amazon.com/forecast/latest/dg/how-it-works.html</a></h4><h3>If you liked this post, please clap for it; follow me if you want more such posts!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=718e7ec579d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/grow-your-business-by-forecasting-its-future-amazon-forecast-718e7ec579d">Grow your business by forecasting its future using AWS Forecast</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Experience at AWS Developer Summit, 2019]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/my-experience-at-aws-developer-summit-2019-ee401744dbe6?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/ee401744dbe6</guid>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deepracer]]></category>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Mon, 26 Aug 2019 08:01:17 GMT</pubDate>
            <atom:updated>2019-08-27T12:16:19.559Z</atom:updated>
            <content:encoded><![CDATA[<h3>My Experience at the AWS Developer Summit and Machine Learning (ML) track, 2019</h3><p>Amazon Web Services had organized its 1st Developer Summit in Seattle. Approximately 65 Developers spread over various tracks ( Containers, Serverless, Databases, AI/ML, and Dev Tools) were invited from all over the globe in which I was the only one from India. The event was for 3 days in which the 1st Day was common for all the tracks and Day 2 and Day 3 focused on respectively specific tracks (in my case “AI/ML track”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nMXWo5SwuY2zHRKN-3uL2A.jpeg" /><figcaption>A meeting room at Amazon Spheres</figcaption></figure><h3>Day 1:</h3><p>Amazon Web Services experts developed and tracks on the vision and strategic investments for categories like serverless, databases, and machine learning (ML)… I’m excited to start using them.</p><p>Participants got to interact with Amazon Employees and could share their current problems and feedback with any services that they use while solving real-life problems.</p><p>After the sessions, we were invited to the “Amazon Spheres” for drinks and dinner. The place was just majestic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q20FV9NNPZ8zTYOmazgHEA.png" /><figcaption>Amazon Spheres, Seattle, USA</figcaption></figure><h3>Day 2:</h3><p>The next day started with everyone’s face lit up and recovered from Jet Lag. We all were very excited to get started with the AI/ML tracks. Excitement skyrocketed when we got an “ AWS DeepLens” from Amazon.</p><figure><img alt="DeepLens" src="https://cdn-images-1.medium.com/max/1024/1*HUDI9Y-K-jfUCeGVSGqOwg.jpeg" /><figcaption><a href="https://aws.amazon.com/deeplens/">https://aws.amazon.com/deeplens/</a></figcaption></figure><ol><li>AWS <strong>Deepracer workshop: </strong>AWS Deepracer is an amazon service and is the easiest way to get started with Reinforcement Learning. I was a 90 minutes session by <a href="https://medium.com/u/4888743f010f"><strong>Scott Pletcher</strong></a> which explained a lot about how to get started using AWS Deepracer. We also had a virtual competition of completing 100% track in the most possible time. It was tougher to make the deepracer car run slowly. Among all, I got the slowest lap time.</li></ol><p><strong>2.</strong> AWS <strong>Deepracer Community:</strong> <a href="https://medium.com/u/b17342579238"><strong>Lyndon Leggate</strong></a> explained how to he started the AWS Deepracer Community. He was at the London AWS Summit competing in the AWS Deepracer League. There he started talking with few of the folks who were also there for the League and after the event, all of them wanted to continue the talk. So he ended up creating a slack channel for it. Since then in the last 4 months, the community has grown to more than 10,000 Deepracing Enthusiasts. He also shared the vision for this community. To join the community visit <a href="http://www.deepracing.io"><strong><em>www.deepracing.io</em></strong></a></p><p><strong>3.</strong> <strong>Recommendation using Amazon SageMaker: </strong><a href="https://medium.com/u/1ec579663bf0"><strong>Pavlos Mitsoulis</strong></a>, A Data Scientist at Expedia Group explained how he had built a “Hotel Recommendation System” using Amazon SageMaker. He explained how he had built the algorithm and how easy it was to train and deploy a model using Amazon SageMaker.</p><p><strong>4.</strong> <strong>AWS DeepLens: Alex Schultz </strong>explained how he found a solution to read storybooks to his kids using AWS DeepLens. He built a solution that was trained on a lot of kid storybooks called “ReadToMe”. Using ReadToMe if a storybook is held in front of the AWS Deeplens it would read the story like a normal human being.</p><p>After this, we had a few lighting talks each for 15 minutes.</p><ol><li>The first one was by <a href="https://medium.com/u/28d40fb71177"><strong>Or Hiltch</strong></a> which explained the importance of having a structured way of writing a technical blog. A blog can be structured as:</li></ol><p>What — Explain the reader about the problem that you are going to solve.</p><p>Why — Why the reader should read the blog and what will he learn.</p><p>How — Explain how are you solving the problem</p><p>Summary — It’s very important to summarize your blog, as it makes the reader recall whatever he has read without scrolling up the blog.</p><p><strong>2.</strong> <a href="https://medium.com/u/8b7ab157b0a4"><strong>Agustinus Nalwan</strong></a> explained how to keep your talk interesting to have the maximum impact of your talk. He also talked about how can we keep the audience engaged coming from different backgrounds. Be it someone who is just graduated to someone who knows everything about the topic of your talk.</p><p><strong>3.</strong> <a href="https://medium.com/u/5db9d9fb5752"><strong>Kesha Williams</strong></a> told us that she gets asked that she is always at a conference. Continuing further she explained how we can create a great social presence and to reach a point where if we enter a room, we need not have to introduce ourselves.</p><p>Kesha also shared a few tips with us:</p><p>1. Don’t be afraid to tell your story.</p><p>2. Technical expertise can’t stand on its own.</p><p>3. You don’t have to be an expert.</p><p>4. Be ready for criticism.</p><p>After all the sessions, We were taken to the Living Computer Museum. It provides a one-of-a-kind, hands-on experience with computer technology from the 1960s to the present. It honors the history of computing with the world’s largest collection of fully restored and usable supercomputers, mainframes, minicomputers, and microcomputers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NxEe335GR9QrC9t7Q_safg.png" /><figcaption>Living Computer Museum</figcaption></figure><h3>Day 3</h3><p>It was the last day of our session and the morning started with everyone building up their social network with each other.</p><ol><li><strong>The Technological Founder Evolution Path: </strong>The Co-founder and CTO at Skyline AI <a href="https://medium.com/u/28d40fb71177"><strong>Or Hiltch</strong></a> explained his transformation through different phases of building up his own company. A company that started with 3 and grew to 35 demanded all kinds of different roles from him.</li></ol><p><strong>2.</strong> <strong>Amazon Lex: </strong>The talk on Lex by <a href="https://medium.com/u/a1b86cc5f4b7"><strong>Gillian Armstrong</strong></a> focused not on building the bot using Lex, but on things that get neglected while building a successful Chatbot. She explained how building a chatbot from POC to Production is not a linear line but it’s an exponential curve.</p><p>3. <strong>Amazon SageMaker Ground Truth: </strong>We had a workshop by <strong>Mahendra Bairagi</strong> on Ground Truth. Amazon SageMaker Ground Truth helps you build highly accurate training datasets for machine learning. It offers easy access to public and private human labelers and provides them with built-in workflows and interfaces for common labeling tasks.</p><p>4. <strong>Amazon Personalize: </strong>The Second workshop was by <a href="https://medium.com/u/e0198eb739e3"><strong>Chris King</strong></a> and <a href="https://www.linkedin.com/in/yifei-ma-48503620"><strong>yifei ma</strong></a> was on Amazon Personalize. It is a machine learning service that makes it easy for developers to create individualized recommendations for customers using their applications.</p><p>The Day and the Event concluded with Good-byes to everyone and connecting on social media for future collaborations.</p><h4>Kudos to the Team (<a href="https://www.linkedin.com/in/cameronperon/">Cameron Peron</a>, <a href="https://medium.com/u/851e2d04d476">Ian Massingham</a>, <a href="https://medium.com/u/1e13e27096c5">Ross Barich</a>, and others) for organizing an impeccable event. It was a great mixture of learning, networking, and fun. Finally, Thanks to AWS for Sponsoring the complete event.</h4><blockquote>My overall experience was very good. I was very happy with how the events were scheduled and the workshops were very helpful to get us started with using the technology.</blockquote><blockquote>It was nice to meet amazon employees who work on the technology that we use since it helped us convey our suggestions to the respective Project Managers about the product and also give feedback on their work.</blockquote><h3>If you liked this post, clap for it; follow me if you want more such posts!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee401744dbe6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/my-experience-at-aws-developer-summit-2019-ee401744dbe6">My Experience at AWS Developer Summit, 2019</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Virtual Reality Chatbot using AWS Sumerian | AWS]]></title>
            <link>https://medium.com/vaibhav-malpanis-blog/how-to-build-a-virtual-reality-chatbot-using-aws-sumerian-aws-ecccb357ffd6?source=rss----eba21a89178c---4</link>
            <guid isPermaLink="false">https://medium.com/p/ecccb357ffd6</guid>
            <category><![CDATA[vr]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[sumerian]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[virtual-reality]]></category>
            <dc:creator><![CDATA[Vaibhav Malpani]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 04:31:01 GMT</pubDate>
            <atom:updated>2019-08-08T09:28:52.903Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer: </strong>This blog will only explain components used for building VR Chatbot.</p><p>In my <a href="https://medium.com/vaibhav-malpanis-blog/traditional-chatbot-vs-virtual-reality-bot-aws-sumerian-4866e4f51693"><strong><em>previous blog</em></strong></a><strong><em>, I</em></strong> spoke about the importance of having a VR Chatbot over a Traditional Chatbot. Here I’ll explain how exactly would you start building a VR Chatbot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tZcjXMpqbN1GO8v0Rz2VZg.png" /></figure><h3>Steps:</h3><ol><li>AWS Configuration</li><li>Start a Scene</li><li>Import a host</li><li>Speech Component</li><li>State Machine</li><li>Dialogue Component</li></ol><h3>1. AWS Configuration:</h3><p>AWS Sumerian requires a lot of rules and IAM configuration and it’s quite tough to do it all correctly and quickly (I wasted 2 days on it). So just to make things easier, You can use this <a href="https://docs.sumerian.amazonaws.com/tutorials/create/beginner/aws-setup/">link </a>,which will do all the configuration required for AWS Sumerian.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*LXNRhUQXqGHkbD4USNSzGA.png" /></figure><p>From the above image, click on “<strong>Launch Stack</strong>” besides “<strong>Using Host, Speech and Dialogue Components”</strong>.</p><p>After the configuration is complete, go to “output” tab, there you will get “Congnito Identity Pool ID”. Copy it somewhere, you would be need it in the coming steps.</p><h3>2. Start a Scene</h3><p>Go to <a href="https://console.aws.amazon.com/console/home?region=us-east-1">AWS console</a>, seach for “Amazon Sumerian” service and open it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ImS1VRkzNHxfjZ181OdwqQ.png" /></figure><p>Click on “Create new scene”, give a name for your scene, click create and wait for it to load.</p><p>On loading you will see below screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7TGB3GbTUIglO-qwXE1GQ.png" /></figure><p>On the Top Right hand side you would see “AWS Configuration”. Click on it to toggle and enter the “Congnito Identity Pool ID” in the provided text box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2b3Q9g7JBuGESA_yEzpF8g.jpeg" /></figure><p>That’s it! All the configuration for our Chatbot are done now. Let’s get to the Exciting part.</p><h3>3. Import a host</h3><p>To create a VR chatbot, Let’s start with Getting a Host for your Chatbot. Host is essentially a face for you Chatbot.</p><p>Click on “Import Assets” at the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-RV-rqe65x2M4N2WNyfcg.jpeg" /></figure><p>You can scroll down to see lot of “Host Assets”. Select any hosts from various options offered and click on add.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MR9NRjz3pRJ0tnZugl10YA.png" /></figure><p>You would see it in the left lower corner</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/221/1*866TBm8aXIOXkbP3yw7rog.jpeg" /></figure><p>Now to get the host in your scene, toggle the imported “host asset” (in this case ‘Wes TShirt’) and select and drag the host entity(the one in red in the image) to the middle of your scene.</p><p>Sometimes the host is too small to even get noticed. Try zooming in to the scene by scrolling up with your mouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*e3_QPYHvZ7LjBmjOkN58OA.png" /></figure><p>Your scene is now ready with your host in the middle.</p><h3>4. Speech Component</h3><p>Let’s now give a voice to the host.</p><p>Click on the host and in the right side corner you will see all the configurations that you can add to the host.</p><p>Click on add component and select “Speech” if it’s not present. You can now select a wide range of Voices depending on the gender of your host and also the locale in which you plan to use the Chatbot.</p><p>Click on the “+” sign to add a speech. A new window would popup. Here you can add any speech that you want and save it. The newly created speech would be shown in the bottom left corner. Select it and drag it to the speech setting. You can click play besides the speech object to hear the voice select and try changing it till you find a perfect match.</p><p>Just below that you would find a “Gesture Map”. Click on it to toggle and then click “+”. It will add a new “DefaultGestureMap”. You can open if from the bottom left corner and change it if you want to. For most of the cases it works quite fine. Select</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*6HhXfjPH-MoI_Jn83eTYCA.png" /></figure><p>Now to add Gesture to our Speech, Select the button highlighted in the image.</p><p>After that click on edit speech, to see the speech file. Now you might notice that few different lines are added to your speech file.</p><h3>5. State Machine:</h3><p>This essentially is a way of guiding the Sumerian entities about how to perform one action after other. Here we have states and actions are added to each step. Using the state machine graph, we can create a path for our entity.</p><p>To start making the State Machine for the host, click on host and on the right hand side select “Add Component” and then select “State Machine”. Click on “+” to start building your behaviour.</p><p>You would now see a “State Machine Graph”. You can rename the “state 1” to whatever name you want. On the right side of the graph, click on “Add action”. A new window pops up. In the search bar type “<strong>AWS SDK Ready</strong>” and select it. This action basically checks if all the AWS Configurations are ready to use. On the top on State Machine Graph, Select “Add State”. Click on the state and select “add action” and search for “<strong>Start Speech</strong>” and select add. After adding the action you will need to select which speech to run on the right side. After this you now need to connect these states. You can do that by selecting “On AWS SDK Ready” and dragging the arrow to the “start speech” state. At the end of all this, your State Machine graph Should look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*COltje9K0TPOBT34Gz_HPw.png" /></figure><p>Now we are done with “speech setting” for the Host. You can now try clicking on “Play the Scene” in the middle at the bottom and Voila!! The host has started speaking. Notice that it is also giving gestures based on the words in your speech.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FczaYvFqM37U%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DczaYvFqM37U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FczaYvFqM37U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/da6b9362dadc7fd2a6e1ed02f550430f/href">https://medium.com/media/da6b9362dadc7fd2a6e1ed02f550430f/href</a></iframe><h3>6. Dialogue Component</h3><p>To start off you will have to <a href="https://medium.com/@MissAmaraKay/first-chatbot-experience-with-aws-amazon-lex-677b63e35c70"><strong><em>build a Amazon Lex bot</em></strong></a>. This bot should include the conversation that you want in your VR Chatbot. After you have built and tested the functionality of you Lex bot, copy and save the name of your Lex bot.</p><p>Click on the host and on the right hand side select “Add Component” and then select “Dialogue”. Paste the name of your bot in Bot Name and below that put “$LATEST” for Bot Alias to always get the latest version of your Lex bot.</p><p>Now the behavior for conversational chatting would be different from a normal speech. So to start conversing with your host we will have to build a new State Machine Graph.</p><p>Action used in each state of State Machine graph</p><ol><li>AWS SDK Ready</li><li>Intro speech — speech that would introduce the bot (optional)</li><li>Key down — select a key on right hand side</li><li>Start Microphone Recording, Key up — select the same key that you selected in previous step</li><li>Stop Microphone Recording.</li><li>Send Audio Input to Dialogue Bot</li><li>Start Speech — check “Use Lex Response” on right hand side</li></ol><p><strong>Join these states as mentioned below:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j7hEIw9E2QAV7SEgDWlcJg.png" /></figure><p>That’s it!! Now playing the scene to see your Virtual Chatbot in action!</p><h3>Applications:</h3><ol><li>Booking Appointment for Restaurant, Doctor’s office, Hotel and Flight Booking etc.</li><li>FAQ about your organization or any specific products.</li></ol><h3>If you liked this post, 👏 for it; follow me if you want more such posts!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecccb357ffd6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vaibhav-malpanis-blog/how-to-build-a-virtual-reality-chatbot-using-aws-sumerian-aws-ecccb357ffd6">How to Build a Virtual Reality Chatbot using AWS Sumerian | AWS</a> was originally published in <a href="https://medium.com/vaibhav-malpanis-blog">Vaibhav Malpani’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>