Introduction To ML
Introduction To ML
Unless stated otherwise, images, code and text is based on course book Deep Learning
with PyTorch by Eli Stevens, Luca Antiga, and Thomas Viehmann
©2020 by Manning Publications Co. All rights reserved.
INTRODUCTION TO ML
‣ Overview
‣ Deep supervised, unsupervised and
reinforcement learning
‣ Deep learning revolution
‣ Competitive landscape
‣ PyTorch overview
‣ Hardware and software requirements
INTRODUCTION TO ML
‣ Overview
What is Machine Learning?
Artificial intelligence (AI) is the ability of machines to perform tasks that are typically associated with human
intelligence, such as learning and problem-solving
Artificial
Intelligence
Scope Functionality
Type definitions
1.Artificial Narrow Intelligence: AI designed to complete very specific actions; unable to independently learn.
2.Artificial General Intelligence: AI designed to learn, think and perform at similar levels to humans.
4.Reactive Machines: AI capable of responding to external stimuli in real time; unable to build memory or store
5.Limited Memory: AI that can store knowledge and use it to learn and train for future tasks.
6.Theory of Mind: AI that can sense and respond to human emotions, plus perform the tasks of limited memory
machines.
7.Self-aware: AI that can recognize others’ emotions, plus has sense of self and human-level intelligence; the final
stage of AI.
Machine Learning
Machine Learning is all about Math tools all put together in an outstanding order
✓ Linear Algebra
✓ Calculus
✓ Statistics
✓ Numerical analysis
✓ Metrics evaluation
Machine learning: design and implementation of of computer algorithms that improve automatically using:
❑ Data; and/or
Training examples/observations: input as a vector or real numbers, desired output is also a value (otherwise, we
need to develop a proper representation)
After training can then infer the values for new, unseen examples.
Deep learning for automated scoring of liver fibrosis stages from microscopy images.
Unsupervised learning
- Generative Adversarial Networks (GAN): learn to generate new examples ”similar” (i.e., hard to distinguish)
from the original dataset. Example: new synthetic features.
- Anomaly detection: identify samples that are not “fit” the pattern of the data.
Example of an autoencoder
Reinforcement learning
Usually, the target model of the decision process that represents the environment is not known (or too
complex to build a Markov Decision Process). Learning happens through interaction.
Key difference with supervised learning: actions and data are coupled. Exploration vs. exploitation.
Examples:
Agent
Environment
Deep reinforcement learning
Example, DOTA 2
https://www.twitch.tv/videos/410533063?t=44m53s
We want to obtain useful representations and make the machine produce desired outputs
During training, we use a criterion, a real-valued function of model outputs and reference data, to provide
a numerical score for the discrepancy between the desired and actual output of our model
• by convention, a lower score is typically better, and we use the term loss
Training consists of driving the criterion toward lower and lower scores by incrementally modifying our
deep learning machine until it achieves low scores, even on data not seen during training.
INTRODUCTION TO ML
‣ Overview
‣ Deep supervised, unsupervised and
reinforcement learning
‣ Deep learning revolution
‣ Competitive landscape
The deep learning competitive landscape
Language:
- Python, by far (no doubt). Interpreted but PyTorch is written in C++ and CUDA, a C++-like language from
NVIDIA. So heavy-lifting happens outside Python, and in specialized hardware.
- C++, not first choice. Only when running things very close to the hardware, like new code directly on GPUs.
For inference, it is possible to export a python trained model to a C++ runtime.
Libraries on Python:
• TensorFlow has a robust pipeline to production, an extensive industry-wide community, and massive
mindshare.
• PyTorch initially, research and teaching communities, thanks to its ease of use. Now great
momentum into industry.
Search interest (red TensorFlow, blue PyTorch)
Last 5 years
Search interest (red TensorFlow, blue PyTorch)
Last 12 months
Search interest (September 2021 to September 2022)
Why PyTorch
❑ Simplicity
❑ Pythonic
❑ History:
• Tensors as Data:
• Both tensors and the operations on them can be used on the CPU or the GPU/TPU.
• used for numerical optimization, and it is provided natively through autograd engine under the
hood.
Overview
INTRODUCTION TO ML
‣ Overview
‣ Deep supervised, unsupervised and
reinforcement learning
‣ Deep learning revolution
‣ Competitive landscape
‣ PyTorch overview
‣ Hardware and software requirements
Hardware and software requirements
Training:
❖ Simple models we will use in class, any recent laptop or personal computer
• 200 GB disk
Inference: