class: middle, center, title-slide .center[.width-60[]] # AI Black Belt: Yellow Day 1/4: Introduction to Machine Learning with Python
--- class: middle ## Outline [Day 1] Introduction to machine learning with Python - Overview of artificial intelligence and machine learning - Get familiar with the data Python ecosystem. - Train your first ML model. .inactive[ [Day 2] Learn to identify and solve supervised learning problems [Day 3] Practice regression algorithms for sentiment analysis [Day 4] Learn how to let the machine tune itself ] --- class: middle ## Philosophy Learn through practice. --- class: middle # Artificial Intelligence
& Machine Learning --- class: middle, center .width-70[] "With artificial intelligence we are summoning the demon" -- Elon Musk --- class: middle, center .width-60[] "We're really closer to a smart washing machine than Terminator" -- Fei-Fei Li, Director of Stanford AI Lab. --- class: middle, center .width-90[] What do you see? ??? How do you do that?! --- class: middle, center .italic[ How to write a computer program that would solve tasks we cannot even start describing how we solve them ourselves? ] --- class: middle, center Instead, write programs that **learn** to solve tasks. --- class: middle, center, black-slide .grid[ .kol-1-2[.width-100[]] .kol-1-2[
.width-100[]] ] The Perceptron (Rosenblatt, 1959). --- class: middle .center.width-90[] The Neocognitron (Fukushima, 1980) is a computer implementation of a **neural network** with a visual perception system. .footnote[Credits: Kunihiko Fukushima, [Neocognitron: A Self-organizing Neural Network Model](https://www.rctn.org/bruno/public/papers/Fukushima1980.pdf), 1980.] ??? Les patterns à détecter sont appris, et non hardcodés comme pour le perceptron. --- class: middle .grid[ .kol-2-5.center[.width-80[]] .kol-3-5[
$$\neq \sigma \left(\sum\_i w\_i x\_i + b\right)$$ ] ] .center[Biological inspiration? Not necessarily a good idea.] --- class: middle ## Deep Learning (2012-Present) .center[
The deep learning toolbox ] .footnote[Credits: [Oriol Vinyals](https://twitter.com/OriolVinyalsML/status/1212422497339105280), 2020.] --- class: middle ## What can an AI do today? - Translate spoken Chinese to spoken English, live? - Answer multi choice questions, as good as an 8th grader? - Converse with a person for an hour? - Play decently at Chess? Go? Poker? Soccer? - Buy groceries on the web? in a supermarket? - Prove mathematical theorems? - Drive a car safely on a parking lot? in New York? - Perform a surgery? - Identify skin cancer better than a dermatologist? - Write a funny story? - Paint like Vangogh? Compose music? - Show common sense? --- class: middle, center, black-slide
Speech translation and synthesis (2012) --- class: middle, center, black-slide
Speech synthesis and question answering (Google, 2018) --- class: middle, center, black-slide
Playing Atari games --- class: middle, center, black-slide
Beat the best human Go players (2016) --- class: middle, center, black-slide
Playing soccer (2018) --- class: middle, center, black-slide
Driving a car (NVIDIA, 2016) --- class: middle, center, black-slide
Autopilot (Tesla, 2019) ??? A full build of Autopilot neural networks involves 48 networks that take 70,000 GPU hours to train 🔥. Together, they output 1,000 distinct tensors (predictions) at each timestep. --- class: middle, center, black-slide
... while preventing accidents. --- class: middle, center, black-slide
Learning to walk (2017) ??? Single algorithm for learning! Nothing is hardcoded. Similar to a baby learning to walk. --- class: middle, center, black-slide
Detecting skin cancer (2017) --- class: middle, center .center.width-60[] Google Meena, telling a joke (2020) --- class: middle, center, black-slide
Artistic style transfer (Ruder et al, 2016) --- class: middle, center, black-slide
Compose music (NVIDIA, 2017) --- class: middle, center, black-slide
Image generation (Karras et al, 2018) --- class: middle, center, black-slide
Changing sketches into photorealistic masterpieces (NVIDIA) --- class: middle, center, black-slide
It’s Getting Harder to Spot a Deep Fake Video --- class: middle, center, black-slide
Dali Lives (2019) --- # AI? ML? DL? .center.width-100[] .footnote[Credits: vas3k, [Machine Learning for Everyone](https://vas3k.com/blog/machine_learning/), 2018.] --- class: middle .center.width-70[] .footnote[Credits: vas3k, [Machine Learning for Everyone](https://vas3k.com/blog/machine_learning/), 2018.] --- class: middle count: false .center.width-70[] .footnote[Credits: vas3k, [Machine Learning for Everyone](https://vas3k.com/blog/machine_learning/), 2018.] --- class: middle # Toolbox of the ML engineer --- # Life cycle of an ML application
.center.width-100[] --- count: false # Life cycle of an ML application
.center.width-100[] --- count: false # Life cycle of an ML application
.center.width-100[] --- count: false # Life cycle of an ML application
.center.width-100[] --- count: false # Life cycle of an ML application
.center.width-100[] --- count: false # Life cycle of an ML application
.center.width-100[] --- count: false # Life cycle of an ML application
.center.width-100[] --- # Roles
.center.width-100[] --- # Data analysis ecosystem in Python
.center.width-80[] --- class: middle ## Jupyter .grid[ .kol-1-2[ Create and share documents that contain live code, equations, visualizations and narrative text. Uses include: - data cleaning and transformation - numerical simulation - statistical modeling - data visualization - machine learning ] .kol-1-2[.center.width-100[]] ] --- class: middle ## Numpy NumPy is the fundamental package for numerical data and scientific computing with Python. It contains: - a powerful N-dimensional array object; - sophisticated (broadcasting) functions; - tools for integrating C/C++ and Fortran code; - useful linear algebra, Fourier transform, and random number capabilities. NumPy can also be used as an efficient multi-dimensional container of generic data. --- class: middle ## Pandas Python has long been great for data munging and preparation, but less so for data analysis and modeling. Pandas helps fill this gap, enabling you to carry out your entire data analysis workflow in Python without having to switch to a more domain specific language. .center.width-60[] --- class: middle ## Scikit-Learn .pull-right[] Machine Learning in Python: - simple and efficient tools for data mining and data analysis, - accessible to everybody, and reusable in various contexts, - built on NumPy, SciPy, and matplotlib.
.center.width-90[] --- class: middle ## Deep Learning .center.width-70[] --- class: middle Jump to - `day1-01-jupyter.ipynb` - `day1-02-python.ipynb` (optional) - `day1-03-numpy.ipynb` (optional) - `day1-04-pandas.ipynb` [](https://mybinder.org/v2/gh/AI-BlackBelt/yellow/master) --- class: middle # Supervised learning --- class: middle .center.width-100[] .footnote[Credits: vas3k, [Machine Learning for Everyone](https://vas3k.com/blog/machine_learning/), 2018.] --- # Classification .center.width-70[] .footnote[Credits: vas3k, [Machine Learning for Everyone](https://vas3k.com/blog/machine_learning/), 2018.] --- # Representing data
.center.width-100[] .footnote[Credits: Andreas Mueller, [Introduction to Machine Learning with Scikit-Learn](https://github.com/amueller/ml-workshop-1-of-4/), 2019.] --- # Training and test data
.center.width-100[] .footnote[Credits: Andreas Mueller, [Introduction to Machine Learning with Scikit-Learn](https://github.com/amueller/ml-workshop-1-of-4/), 2019.] --- # Supervised learning workflow .grid[ .kol-1-2[ ```python clf = RandomForestClassifier() clf.fit(X_train, y_train) y_pred = clf.predict(X_test) clf.score(X_test, y_test) ``` ] .kol-1-2[ .center.width-100[] ] ] --- class: middle Jump to `day1-05-scikit-learn.ipynb`. [](https://mybinder.org/v2/gh/AI-BlackBelt/yellow/master) --- class: middle # Case study Jump to `day1-06-case-study.ipynb`.