Summary and Setup

Welcome


This is a hands-on introduction to the first steps in deep learning, intended for researchers who are familiar with (non-deep) machine learning.

The use of deep learning has seen a sharp increase of popularity and applicability over the last decade. While deep learning can be a useful tool for researchers from a wide range of domains, taking the first steps in the world of deep learning can be somewhat intimidating. This introduction aims to cover the basics of deep learning in a practical and hands-on manner, so that upon completion, you will be able to train your first neural network and understand what next steps to take to improve the model.

We start with explaining the basic concepts of neural networks, and then go through the different steps of a deep learning workflow. Learners will learn how to prepare data for deep learning, how to implement a basic deep learning model in Python with Keras, how to monitor and troubleshoot the training process and how to implement different layer types such as convolutional layers.

Prerequisites

Learners are expected to have the following knowledge:

  • Basic Python programming skills and familiarity with the Pandas package.
  • Basic knowledge on machine learning, including the following concepts: Data cleaning, train & test split, type of problems (regression, classification), overfitting & underfitting, metrics (accuracy, recall, etc.).

Software Setup


Installing Python

Python is a popular language for scientific computing, and a frequent choice for machine learning as well. To install Python, follow the Beginner’s Guide or head straight to the download page.

Please set up your python environment at least a day in advance of the workshop. If you encounter problems with the installation procedure, ask your workshop organizers via e-mail for assistance so you are ready to go as soon as the workshop begins.

Installing the required packages


Pip is the package management system built into Python. Pip should be available in your system once you installed Python successfully.

Open a terminal (Mac/Linux) or Command Prompt (Windows) and run the following commands.

  1. Create a virtual environment called dl_workshop:
python3 -m venv dl_workshop
py -m venv dl_workshop
  1. Activate the newly created virtual environment:
source dl_workshop/bin/activate
dl_workshop\Scripts\activate

Remember that you need to activate your environment every time you restart your terminal!

  1. Install the required packages:
python3 -m pip install jupyter seaborn scikit-learn pandas tensorflow

Recent Macs have special chips (M1/M2/M3) that can accelerate deep learning processes. Apple has developed the tensorflow-metal package to support these chips in TensorFlow. This is not supported by the standard TensorFlow installation, and not required for this lesson.

Nevertheless, you can install the on top of the standard tensorflow:

python -m pip install tensorflow-metal
py -m pip install jupyter seaborn scikit-learn pandas tensorflow

Note: Tensorflow makes Keras available as a module too.

Starting Jupyter Lab


We will teach using Python in Jupyter Lab, a programming environment that runs in a web browser. Jupyter Lab is compatible with Firefox, Chrome, Safari and Chromium-based browsers. Note that Internet Explorer and Edge are not supported. See the Jupyter Lab documentation for an up-to-date list of supported browsers.

To start Jupyter Lab, open a terminal (Mac/Linux) or Command Prompt (Windows) and type the command:

jupyter lab

To start the Python interpreter without Jupyter Lab, open a terminal (Mac/Linux) or Command Prompt (Windows) and type the command:

python

Check your setup


To check whether all packages installed correctly, start a jupyter notebook in jupyter lab as explained above. Run the following lines of code:

PYTHON

import sklearn
print('sklearn version: ', sklearn.__version__)

import seaborn
print('seaborn version: ', seaborn.__version__)

import pandas
print('pandas version: ', pandas.__version__)

import tensorflow
print('Tensorflow version: ', tensorflow.__version__)

This should output the versions of all required packages without giving errors. Most versions will work fine with this lesson, but: - For Keras and Tensorflow, the minimum version is 2.12.0 - For sklearn, the minimum version is 1.2.2

Fallback option: cloud environment


If a local installation does not work for you, it is also possible to run this lesson in Binder Hub. This should give you an environment with all the required software and data to run this lesson, nothing which is saved will be stored, please copy any files you want to keep. Note that if you are the first person to launch this in the last few days it can take several minutes to startup. The second person who loads it should find it loads in under a minute. Instructors who intend to use this option should start it themselves shortly before the workshop begins.

Alternatively you can use Google colab. If you open a jupyter notebook here, the required packages are already pre-installed. Note that google colab uses jupyter notebook instead of Jupyter Lab.

Downloading the required datasets


Download the weather dataset prediction csv and Dollar street dataset (4 files in total)