Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python:...

26
Introduction to Deep Learning (I2DL) Exercise 3: Python and Data

Transcript of Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python:...

Page 1: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Introduction to Deep Learning (I2DL)

Exercise 3: Python and Data

Page 2: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Today’s Outline

• Python Setup• Jupyter Notebooks• Contents of the first python exercise

– Example Datasets in Machine Learning– Dataloader

• Submission system

• Number of submissions: 3

2I2DL: Prof. Niessner, Prof. Leal-Taixé

Page 3: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Some notes on ”effort” and the exam• Exercise sessions generally will be short (~45min)• Practical tasks will take time both to

– implement– run and test network configurations

• In the end, you will receive– A 0.3 bonus on the final grade, if you pass all but one

submission– Practical experience for work/internships/thesis

3I2DL: Prof. Niessner, Prof. Leal-Taixé

Page 4: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Lecture/Exercise Alignment• All exercise content is relevant for the exam• Generally we try to cover the topics of the previous

lecture

• However– Giving you a second view on the material presented in

the lectures– We might cover content that will be presented later in the

lecture

4I2DL: Prof. Niessner, Prof. Leal-Taixé

Page 5: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Your task for the next exercises

• Implementation of• Classic datasets and data loading• Classification pipeline using

– Traditional machine learning methods– Neural Networks

• Layers• Optimizers• Etc.

• „Reimplement the wheel“

I2DL: Prof. Niessner, Prof. Leal-Taixé 5

Page 6: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Python “Introduction”

• Why python:– Very easy to write development code thanks to an

intuitive syntax– A plethora of inbuilt libraries, esp. for deep learning

– Biggest language used in deep learning research

• Mainly we will use– Jupyter notebooks– Numpy– Pytorch

I2DL: Prof. Niessner, Prof. Leal-Taixé 6

Page 7: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Live Demo(Jupyter notebooks)

Page 8: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Python Setup

• New users: install python3.7– README.md

• “Advanced” users:– Virtual environment via anaconda/whatever– Regular system python install in this environment

• pip install -r requirements.txt

New python users: http://nbviewer.jupyter.org/github/jrjohansson/scientific-python-lectures/blob/master/Lecture-1-Introduction-to-Python-Programming.ipynb

I2DL: Prof. Niessner, Prof. Leal-Taixé 8

Page 9: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Submission Start

• We will open the submission system next week– So don’t worry if you can’t submit right away

• External students with TUM/LMU affiliation– Use the google form for external TUM/LMU affiliated

students to sign up– We will send you a matriculation number which you can

use to sign up

9I2DL: Prof. Niessner, Prof. Leal-Taixé

Page 10: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

How to submit exercises

• Register at our submission webpage(https://dvl.in.tum.de/teaching/submission/)– Sign up with valid matriculation number– Get id and password via mail from tum-online (it will

display the email address)

• Submit models with– Upload models for respective exercise by zipping them

(no rar, gzip)– Note: You will submit your whole code folder as well as

your trained models (there are file limits)I2DL: Prof. Niessner, Prof. Leal-Taixé 10

Page 11: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

How to submit exercises

• On the submission webpage– Upload your zipped exercise folder– Select the model you want to evaluate

• Wait for the email with your score– Uses email that you signed up with– Refresh webpage until it no longer says „job currently

waiting in queue“ and check out your score on the webpage and via email

I2DL: Prof. Niessner, Prof. Leal-Taixé 11

Page 12: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Submission Overview• We will announce the number of submissions for each

exercise• Optional notebooks are not numbered or tagged as

optional

• Every submission has a submission goal– Goal: Implement a sigmoid function– Reachable points [0, 100]– Threshold to clear exercise: 100– Submission start: May 11, 2020 23:59– Submission deadline: May 17, 2020 23:59

12I2DL: Prof. Niessner, Prof. Leal-Taixé

Page 13: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

The Pillars of Deep Learning

13I2DL: Prof. Niessner, Prof. Leal-Taixé

Data Model Solver

Dataset

Dataloader

Network

Loss/Objective

Optimizer

Training Loop

Validation

Page 14: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Network

Loss/Objective

Dataset

Dataloader

The Pillars of Deep Learning

14I2DL: Prof. Niessner, Prof. Leal-Taixé

Data Model Solver

Optimizer

Training Loop

Validation

{𝑥!:#, 𝑦!:#}

Page 15: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Dataset

• Stores the data in an efficient, accessible form• Performs data preprocessing steps using Transforms• Example: Image Folder Dataset

15I2DL: Prof. Niessner, Prof. Leal-Taixé

, cat

, cat

, cat

dataset[2]

dataset

image:

label: “cat”

Page 16: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

DataLoader

• Defines how to load the dataset for model training• Shuffles the dataset• Splits the dataset into small subsets

16I2DL: Prof. Niessner, Prof. Leal-Taixé

Page 17: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

The Pillars of Deep Learning

17I2DL: Prof. Niessner, Prof. Leal-Taixé

Data Model Solver

Dataset

Dataloader

Network

Loss/Objective

Optimizer

Training Loop

Validation

Page 18: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

The Pillars of Deep Learning

18I2DL: Prof. Niessner, Prof. Leal-Taixé

Data Model Solver

Dataset

Dataloader

Network

Loss/Objective

Optimizer

Training Loop

Validation

Can be implemented once and used in multiple projects

Page 19: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Exercises FAQ

• I don’t want to code in notebooks. Can I use my favourite IDE?– Yes

• Cool, so I can just change the whole code structure?– No– You can write any helper functions, but keep the skeleton

classes intact (i.e., don’t rename important functions or variables)

– You will upload all files and those will be archived on our end

I2DL: Prof. Niessner, Prof. Leal-Taixé 19

Page 20: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Threshold and Submission FAQ

• How do I know that I passed?– Once you submit a score that surpasses the threshold,

you will receive an email that contains a message which tells you that you passed this submission

• Help, I got this message a second time!?– You will receive this message every time you submit an

exercise that exceeds the score

I2DL: Prof. Niessner, Prof. Leal-Taixé 20

Page 21: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Threshold and Submission FAQ

• I submitted another model which was below the threshold. Do I have to resubmit the old model?– No, once one models surpasses the threshold, you are

done with this submission (for the bonus)

• How much time do we have for each set of submissions?- See submission goals in the corresponding notebook

I2DL: Prof. Niessner, Prof. Leal-Taixé 21

Page 22: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Threshold and Submission FAQ

• Is there a limit on how often I can submit?– We will publish a detailed submission limit at the

beginning of the next week

• Will there always be three submissions?!– Nope ;). Most exercises will have a single submission

I2DL: Prof. Niessner, Prof. Leal-Taixé 22

Page 23: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Threshold and Submission FAQ

• How long does it take to do a submission?!– Depends on the submission, however you will have to

train models for later submissions which can take “hours” to run on your machine, regardless how much coding you have to do

I2DL: Prof. Niessner, Prof. Leal-Taixé 23

Page 24: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

Upcoming Lectures

• Next lecture: Lecture 4: Backpropagation

• Next Thursday: Solver and first Network with Patrick

24

Page 25: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

The Pillars of Deep Learning

25I2DL: Prof. Niessner, Prof. Leal-Taixé

Data Model Solver

Dataset

Dataloader

Network

Loss/Objective

Optimizer

Training Loop

Validation

Page 26: Introduction to Deep Learning (I2DL) · 2020-06-04 · Python “Introduction” •Why python: –Very easy to write development code thanks to an intuitive syntax –A plethora

See you next week J