Final Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Industrial Training

Report On
AWS ML Foundations

Submitted in Partial Fulfillment of the Requirement for the Award of the


Degree of To

VEER BAHADUR SINGH PURVANCHAL


UNIVERSITY, JAUNPUR

Under the Supervision


Mr. Purnendra
Srivastav
(Assistant Professor)
Mr. Sunil Yadav

(Assistant Professor)

Submitted By:
Gaurav Shukla (185437)

DEPARTMENT OF INFORMATION TECHNOLOGY


UNSIET VBSPU JAUNPUR
DECEMBER, 2021
https://confirm.udacity.com/4LHSNAHK
CERTIFICATE

It is certified that, this industrial training report entitled “AWS ML Foundations”,


submitted by Gaurav Shukla in partial fulfillment of the requirement for the award of
Bachelor of Technology in Information Technology degree from VBS Purvanchal
University, Jaunpur, is record of students own study carried during summer training.

Guide’s Signature

Mr. Sunil Yadav


(Assistant Professor)

Mr. Purnendra Srivastav


(Assistant Professor)
ACKNOWLEDGEMENT

It is with sense of gratitude; I acknowledge the efforts of entire hosts of well-wishers who
have in some way or other contributed in their own special ways to the success and
completion of the Industrial Training. Successfully completion of any type of technology
requires helps from a number of sources. I have also taken help from different sources. Now,
there is little effort to show my deep gratitude to those helpful people and community. I
would like to express my sense of gratitude and indebtedness to team Udacity from the
bottom of my heart, for their immense support and guidance throughout the training, without
their kind direction and proper guidance this study would have been a little success. I would
also like to dedicate my special thanks to our Information Technology department who given
me such a golden chance to perform such industrial training activity.
ABSTRACT

In this report, I discussed about what machine learning actually is, introduced you to some of
the most common terms and ideas used in machine learning, and identified the common
components involved in machine learning projects. I discussed that machine learning
involves using trained models to generate predictions and detect patterns from data. I looked
behind the scenes to see what is really happening. I also broke down the different steps or
tasks involved in machine learning. I discussed many advanced machine learning techniques.
Specifically: Computer vision and its application. How to train a computer vision project with
AWS DeepLens, Reinforcement learning and its application. How to train a reinforcement
learning model with AWS DeepRacer, Generative AI, How to train a GAN and AR-CNN
model with AWS DeepComposer.
TABLE OF CONTENTS

S. NO CONTENTS PAGE NO

1 List Of Figures 1
2 Introduction 2-4
3 Introduction to Five machine learning steps 5-12
4 Introduction to Machine Learning with AWS 13-16
5 Reinforcement Learning 17-18
6 Generative AI and its Applications 19-20
7 Conclusion 21
8 References 22
1. LIST OF FIGURES

FIG. NO. FIGURE NAME PAGE NO.

2.1.1. Clay analogy for machine learning 3

2.1.2. Snow cones sold regression chart 4


2.2.1. Steps of machine learning 5

2.2.2. Machine learning tasks 6


2.2.3. Labeled data 7
2.2.4. Sample Pictures 8
2.2.5. Steps of working with data 9
2.3.1. ML infrastructure and frameworks 14

2.3.2. AWS educational devices 14


2.3.3. Some examples of real-world RL 18
2.3.4. Discriminative versus Generative algorithms 19

1
2. INTRODUCTION

2.1. Introduction to Machine Learning

Machine learning (ML) is a modern software development technique and a type of artificial
intelligence (AI) that enables computers to solve problems by using examples of real-world
data. It allows computers to automatically learn and improve from experience without being
explicitly programmed to do so.

Machine learning is creating rapid and exciting changes across all levels of society.

• It is the engine behind the recent advancements in industries such as autonomous


vehicles.
• It allows for more accurate and rapid translation of the text into hundreds of
languages.
• It powers the AI assistants you might find in your home.
• It can help improve worker safety.
• It can speed up drug design.

Machine learning is part of the broader field of artificial intelligence. This field is concerned
with the capability of machines to perform activities using human-like intelligence. Within
machine learning there are several different kinds of tasks or techniques:

• In supervised learning, every training sample from the dataset has a corresponding
label or output value associated with it. As a result, the algorithm learns to predict
labels or output values.
• In unsupervised learning, there are no labels for the training data. A machine
learning algorithm tries to learn the underlying patterns or distributions that govern
the data.

• Reinforcement learning

2
2.1.1 Components of Machine Learning

Fig.2.1.1. Clay analogy for machine learning

Nearly all tasks solved with machine learning involve three primary components:

• A machine learning model


• A model training algorithm
• A model inference algorithm

Clay Analogy for Machine Learning


We can understand the relationships between these components by imagining the stages of
crafting a teapot from a lump of clay.

1. First, you start with a block of raw clay. At this stage, the clay can be molded into
many different forms and be used to serve many different purposes. You decide to use
this lump of clay to make a teapot.
2. So how do you create this teapot? You inspect and analyze the raw clay and decide
how to change it to make it look more like the teapot you have in mind.
3. Next, you mold the clay to make it look more like the teapot that is your goal.

3
What are machine learning models?

A machine learning model, like a piece of clay, can be molded into many different forms and
serve many different purposes. A more technical definition would be that a machine learning
model is a block of code or framework that can be modified to solve different but related
problems based on the data provided.

Important

A model is an extremely generic program (or block of code), made specific by the data used
to train it. It is used to solve different problems.

Example 1

Imagine you own a snow cone cart, and you have some data about the average number of
snow cones sold per day based on the high temperature. You want to better understand this
relationship to make sure you have enough inventory on hand for those high sales days.

Fig.2.1.2.Snow cones sold regression chart


In the graph above, you can see one example of a model, a linear regression model (indicated
by the solid line). You can see that, based on the data provided, the model predicts that as the

high temperate for the day increases so do the average number of snow cones sold. Sweet!

4
2.2 INTRODUCTION TO THE FIVE MACHINE LEARNING
STEPS

Fig.2.2.1Steps of machine learning

2.2.1Major Steps in the Machine Learning Process


In the preceding diagram, you can see an outline of the major steps of the machine learning
process. Regardless of the specific model or training algorithm used, machine learning
practitioners practice a common workflow to accomplish machine learning tasks.

These steps are iterative. In practice, that means that at each step along the process, you
review how the process is going.

How do You Start a Machine Learning Task?


• Define a very specific task.
o Think back to the snow cone sales example. Now imagine that you own a
frozen treats store and you sell snow cones along with many other products.
You wonder, "‘How do I increase sales?" It's a valid question, but it's the
opposite of a very specific task. The following examples demonstrate how a
machine learning practitioner might attempt to answer that question.
▪ “Does adding a $1.00 charge for sprinkles on a hot fudge sundae
increase the sales of hot fudge sundaes?”
▪ “Does adding a $0.50 charge for organic flavors in your snow cone
increase the sales of snow cones?”

5
What is a Machine Learning Task?

All model training algorithms, and the models themselves, take data as their input. Their
outputs can be very different and are classified into a few different groups based on the task
they are designed to solve. Often, we use the kind of data required to train a model as part of
defining a machine learning task.

we will focus on two common machine learning tasks:

• Supervised learning
• Unsupervised learning

Supervised and Unsupervised Learning

Fig.2.2.2.Machine learning tasks

6
Supervised tasks

A task is supervised if you are using labeled data. We use the term labeled to refer to data that
already contains the solutions, called labels.

For example: Predicting the number of snow cones sold based on the temperatures is an
example of supervised learning.

Fig.2.2.3.Labeled data
In the preceding graph, the data contains both a temperature and the number of snow cones
sold. Both components are used to generate the linear regression shown on the graph. Our
goal was to predict the number of snow cones sold, and we feed that value into the model.
We are providing the model with labeled data and therefore, we are performing.

7
Unsupervised tasks

A task is considered to be unsupervised if you are using unlabeled data. This means you don't
need to provide the model with any kind of label or solution while the model is being trained.

Fig. 2.2.4.Sample Pictures

• Take a look at the preceding picture. Did you notice the tree in the picture? What you
just did, when you noticed the object in the picture and identified it as a tree, is called
labeling the picture. Unlike you, a computer just sees that image as a matrix of pixels
of varying intensity.
• Since this image does not have the labeling in its original data, it is considered
unlabeled.

8
Step Two: Build a Dataset

The next step in the machine learning process is to build a dataset that can be used to solve
your machine learning-based problem. Understanding the data needed helps you select better
models and algorithms so you can build more effective solutions.

The most important step of the machine learning process


Working with data is perhaps the most overlooked—yet most important—step of the machine
learning process. In 2017, an O’Reilly study showed that machine learning practitioners
spend 80% of their time working with their data.

Fig.2.2.5.Steps of working with data

You can take an entire class just on working with, understanding, and processing data for
machine learning applications. Good, high-quality data is essential for any kind of machine
learning project. Let's explore some of the common aspects of working with data.

9
Data collection
Data collection can be as straightforward as running the appropriate SQL queries or as
complicated as building custom web scraper applications to collect data for your project. You
might even have to run a model over your data to generate needed labels. Here is the
fundamental question:

Does the data you've collected match the machine learning task and problem you have
defined?

Data inspection

The quality of your data will ultimately be the largest factor that affects how well you can
expect your model to perform. As you inspect your data, look for:

• Outliers
• Missing or incomplete values
• Data that needs to be transformed or preprocessed so it's in the correct format to be
used by your model

Summary statistics

Models can assume how your data is structured.

Now that you have some data in hand it is a good best practice to check that your data is in
line with the underlying assumptions of your chosen machine learning model.

With many statistical tools, you can calculate things like the mean, inner-quartile range
(IQR), and standard deviation. These tools can give you insight into the scope, scale, and
shape of the dataset.

Data visualization
You can use data visualization to see outliers and trends in your data and to help stakeholders
understand.

10
Step Three: Model Training

Splitting your Dataset


The first step in model training is to randomly split the dataset. This allows you to keep some
data hidden during training, so that data can be used to evaluate your model before you put it
into production. Specifically, you do this to test against the bias-variance trade-off. If you're
interested in learning more, see the Further learning and reading section.

Splitting your dataset gives you two sets of data:

• Training dataset: The data on which the model will be trained. Most of your data will
be here. Many developers estimate about 80%.
• Test dataset: The data withheld from the model during training, which is used to test
how well your model will generalize to new data.

Model Training Terminology


The model training algorithm iteratively updates a model's parameters to minimize some loss
function.

Let's define those two terms:

• Model parameters: Model parameters are settings or configurations the training


algorithm can update to change how the model behaves. Depending on the context,
you’ll also hear other more specific terms used to describe model parameters such as
weights and biases. Weights, which are values that change as the model learns, are
more specific to neural networks.
• Loss function: A loss function is used to codify the model’s distance from this goal.
For example, if you were trying to predict a number of snow cone sales based on the
day’s weather, you would care about making predictions that are as accurate as
possible. So you might define a loss function to be “the average distance between
your model’s predicted number of snow cone sales and the correct number.” You can
see in the snow cone example this is the difference between the two purple dots.

11
Putting it All Together
The end-to-end training process is

• Feed the training data into the model.


• Compute the loss function on the results.
• Update the model parameters in a direction that reduces loss.

You continue to cycle through these steps until you reach a predefined stop condition. This
might be based on a training time, the number of training cycles, or an even more intelligent
or application-aware mechanism.

Step Four: Model Evaluation


After you have collected your data and trained a model, you can start to evaluate how well
your model is performing. The metrics used for evaluation are likely to be very specific to the
problem you have defined. As you grow in your understanding of machine learning, you will
be able to explore a wide variety of metrics that can enable you to evaluate effectively.

Using Model Accuracy


Model accuracy is a fairly common evaluation metric. Accuracy is the fraction of predictions
a model gets right.

Using Log Loss


Log loss seeks to calculate how uncertain your model is about the predictions it is generating.
In this context, uncertainty refers to how likely a model thinks the predictions being
generated are to be correct.

Step Five: Model Inference


Congratulations! You're ready to deploy your model.
Once you have trained your model, have evaluated its effectiveness, and are satisfied with the
results, you're ready to generate predictions on real-world problems using unseen data in the
field.

12
2..3. Introduction to Machine Learning with AWS

Why AWS?
The AWS machine learning mission is to put machine learning in the hands of every
developer.

• AWS offers the broadest and deepest set of artificial intelligence (AI) and machine
learning (ML) services with unmatched flexibility.
• You can accelerate your adoption of machine learning with AWS SageMaker. Models
that previously took months to build and required specialized expertise can now be
built in weeks or even days.
• AWS offers the most comprehensive cloud offering optimized for machine learning.
• More machine learning happens at AWS than anywhere else.

AWS Machine Learning offerings


AWS AI services
By using AWS pre-trained AI services, you can apply ready-made intelligence to a wide
range of applications such as personalized recommendations, modernizing your contact
center, improving safety and security, and increasing customer engagement.

Industry-specific solutions
With no knowledge in machine learning needed, add intelligence to a wide range of
applications in different industries including healthcare and manufacturing.

AWS Machine Learning services


With AWS, you can build, train, and deploy your models fast. Amazon SageMaker is a fully
managed service that removes complexity from ML workflows so every developer and data
scientist..

13
ML infrastructure and frameworks
AWS Workflow services make it easier for you to manage and scale your underlying ML
infrastructure.

Fig.2.3.1. ML infrastructure and frameworks

Getting started
In addition to educational resources such as AWS Training and Certification, AWS has
created a portfolio of educational devices to help put new machine learning techniques into
the hands of developers in unique and fun ways, with AWS DeepLens, AWS DeepRacer,
and AWS DeepComposer.

• AWS DeepLens: A deep learning–enabled video camera


• AWS DeepRacer: An autonomous race car designed to test reinforcement learning
models by racing on a physical track
• AWS DeepComposer: A composing device powered by generative AI that creates a
melody that transforms into a completely original song
• AWS ML Training and Certification: Curriculum used to train Amazon developers

Fig.2.3.2. AWS educational devices

14
Introduction to Computer Vision

Computer vision got its start in the 1960s in academia. Since its inception, it has been an
interdisciplinary field. Machine learning practitioners use computers to understand and
automate tasks associated with the visual word.

Modern-day applications of computer vision use neural networks. These networks can
quickly be trained on millions of images and produce highly accurate predictions.

Since 2010, there has been exponential growth in the field of computer vision. You can start
with simple tasks like image classification and objection detection and then scale all the way
up to the nearly real-time video analysis required for self-driving cars to work at scale.

In the video, you have learned:

• How computer vision got started


o Early applications of computer vision needed hand-annotated images to
successfully train a model.
o These early applications had limited applications because of the human labor
required to annotate images.
• Three main components of neural networks
o Input Layer: This layer receives data during training and when inference is
performed after the model has been trained.
o Hidden Layer: This layer finds important features in the input data that have
predictive power based on the labels provided during training.
o Output Layer: This layer generates the output or prediction of your model.
• Modern computer vision
o Modern-day applications of computer vision use neural networks call
convolutional neural networks or CNNs.
o In these neural networks, the hidden layers are used to extract different
information about images. We call this process feature extraction.
o These models can be trained much faster on millions of images and generate a
better prediction than earlier models.
o Larger and larger pre-labeled datasets have become generally available.

15
Computer Vision Applications

Summary
Computer vision (CV) has many real-world applications. In this video, we cover examples of
image classification, object detection, semantic segmentation, and activity recognition. Here's
a brief summary of what you learn about each topic in the video:

• Image classification is the most common application of computer vision in use today.
Image classification can be used to answer questions like What's in this image? This
type of task has applications in text detection or optical character recognition (OCR)
and content moderation.
• Object detection is closely related to image classification, but it allows users to gather
more granular detail about an image. For example, rather than just knowing whether
an object is present in an image, a user might want to know if there are multiple
instances of the same object present in an image, or if objects from different classes
appear in the same image.
• Semantic segmentation is another common application of computer vision that takes
a pixel-by-pixel approach. Instead of just identifying whether an object is present or
not, it tries to identify down the pixel level which part of the image is part of the
object.
• Activity recognition is an application of computer vision that is based around videos
rather than just images. Video has the added dimension of time .

16
Reinforcement Learning and Its Applications

This section introduces you to a type of machine learning (ML) called reinforcement learning
(RL). You'll hear about its real-world applications and learn basic concepts using AWS
DeepRacer as an example. By the end of the section, you will be able to create, train, and
evaluate a reinforcement learning model in the AWS DeepRacer console.

Introduction to Reinforcement Learning


Summary
In reinforcement learning (RL), an agent is trained to achieve a goal based on the feedback it
receives as it interacts with an environment. It collects a number as a reward for each action
it takes. Actions that help the agent achieve its goal are incentivized with higher numbers.
Unhelpful actions result in a low reward or no reward.

With a learning objective of maximizing total cumulative reward, over time, the agent
learns, through trial and error, to map gainful actions to situations. The better trained the
agent, the more efficiently it chooses actions that accomplish its goal.

Reinforcement Learning Applications


Summary
Reinforcement learning is used in a variety of fields to solve real-world problems. It’s
particularly useful for addressing sequential problems with long-term goals. Let’s take a look
at some examples.

• RL is great at playing games:


o Go (board game) was mastered by the AlphaGo Zero software.
o Atari classic video games are commonly used as a learning tool for creating
and testing RL software.
o StarCraft II, the real-time strategy video game, was mastered by the
AlphaStar software.
• RL is used in video game level design:
o Video game level design determines how complex each stage of a game is and
directly affects how boring, frustrating, or fun it is to play that game.
o Video game companies create an agent that plays the game over and over
again to collect data that can be visualized on graphs.

17
o When multiple turbines work together in a wind farm, the turbines in the front,
which receive the wind first, can cause poor wind conditions for the turbines
behind them. This is called wake turbulence and it reduces the amount of
energy that is captured and converted into electrical power.
o Wind energy organizations around the world use reinforcement learning to test
solutions. Their models respond to changing wind conditions by changing the
angle of the turbine blades. When the upstream turbines slow down it helps the
downstream turbines capture more energy.
• Other examples of real-world RL include:
o Industrial robotics
o Fraud detection
o Stock trading
o Autonomous driving

Fig. 2.3.3. Some examples of real-world RL

18
Introduction to Generative AI

Generative AI and Its Applications

Generative AI is one of the biggest recent advancements in artificial intelligence because of

its ability to create new things.

Until recently, the majority of machine learning applications were powered by discriminative
models. A discriminative model aims to answer the question, "If I'm looking at some data,
how can I best classify this data or predict a value?" For example, we could use
discriminative models to detect if a camera was pointed at a cat.

As we train this model over a collection of images (some of which contain cats and others
which do not), we expect the model to find patterns in images which help make this
prediction.

A generative model aims to answer the question,"Have I seen data like this before?" In our
image classification example, we might still use a generative model by framing the problem
in terms of whether an image with the label "cat" is more similar to data you’ve seen before
than an image with the label "no cat."

However, generative models can be used to support a second use case. The patterns learned
in generative models can be used to create brand new examples of data which look similar to
the data it seen before.

Fig.2.3.4.Discriminative versus Generative algorithms

19
Generative AI Models
In this lesson, you will learn how to create three popular types of generative models:
generative adversarial networks (GANs), general autoregressive models.

Autoregressive models
Autoregressive convolutional neural networks (AR-CNNs) are used to study systems that
evolve over time and assume that the likelihood of some data depends only on what has
happened in the past. It’s a useful way of looking at many systems, from weather prediction
to stock prediction.

Generative adversarial networks (GANs)


Generative adversarial networks (GANs), are a machine learning model format that involves
pitting two networks against each other to generate new content. The training algorithm
swaps back and forth between training a generator network (responsible for producing new
data) and a discriminator network (responsible for measuring how closely the generator
network’s data represents the training dataset).

Transformer-based models
Transformer-based models are most often used to study data with some sequential structure
(such as the sequence of words in a sentence). Transformer-based methods are now a
common modern tool for modeling natural language.

Fig.2.3.5. Transformer -based model

20
CONCLUSION

This report is covering almost all the relevant topics that are important whenever performing
the machine learning on AWS. In this report the introductory part of machine learning, their
types and as well as an introduction on AWS have been discussed. I have also described a
concise theoretical concepts about Artificial Intelligence and its types. This report on its
whole covers all sort of machine learning techniques its types and methods as well as all the
machine learning and AI services which are provided by Amazon Web Services and this
report contains almost everything about usage of machine learning on AWS.

21
REFERENCES

https://classroom.udacity.com/me

22

You might also like