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 covers 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.).

Introduction to artificial neural networks in Python

The Introduction to artificial neural networks in Python lesson takes a different angle to introducing deep learning, focusing on computer vision with the application on medical images.

Introduction to machine learning in Python with scikit-learn

The Introduction to machine learning in Python with scikit-learn lesson introduces practical machine learning using Python. It is a good lesson to follow in preparation for this lesson, since basic knowledge of machine learning and Python programming skills are required for this lesson.

Introduction to text analysis and natural language processing (NLP) in Python

The Introduction to text analysis and natural language processing in Python lesson provides a practical introduction to working with unstructured text data, such as survey responses, clinical notes, academic papers, or historical documents. It covers key natural language processing (NLP) techniques including preprocessing, tokenization, feature extraction (e.g., TF-IDF, word2vec, and BERT), and basic topic modeling. The skills taught in this lesson offer a strong foundation for more advanced topics such as knowledge extraction, working with large text corpora, and building applications that involve large language models (LLMs).

Trustworthy AI: Validity, fairness, explainability, and uncertainty assessments

The Trustworthy AI lesson introduces tools and practices for building and evaluating machine learning models that are fair, transparent, and reliable across multiple data types, including tabular data, text, and images. Learners explore model evaluation, fairness audits, explainability methods (such as linear probes and GradCAM), and strategies for handling uncertainty and detecting out-of-distribution (OOD) data. It is especially relevant for researchers working with NLP, computer vision, or structured data who are interested in integrating ethical and reproducible ML practices into their workflows—including those working with large language models (LLMs) or planning to release models for public or collaborative use.

Intro to AWS SageMaker for predictive ML/AI

The Intro to AWS SageMaker for predictive ML/AI lesson focuses on training and tuning neural networks (and other ML models) using Amazon SageMaker, and is a natural next step for learners who’ve outgrown local setups. If your deep learning models are becoming too large or slow to run on a laptop, SageMaker provides scalable infrastructure with access to GPUs and support for parallelized hyperparameter tuning. Participants learn to use SageMaker notebooks to manage data via S3, launch training jobs, monitor compute usage, and keep experiments cost-effective. While the examples center on small to mid-sized models, the workflow is directly applicable to scaling up deep learning and LLM-related experiments in research.

Setup


Please complete the setup at least a day in advance of the workshop. If you run into issues, contact the workshop organizers by email so you’re ready to begin on time. The setup steps include:

  1. Setup workshop folder
  2. Install Python 3.11.9
  3. Setup virtual environment with required packages
  4. Download the data

1. Setup workshop folder


Create a folder on your desktop called dl_workshop for storing the workshop data and required packages.

cd ~/Desktop
mkdir dl_workshop
cd dl_workshop
pwd 

OUTPUT

~/Desktop/dl_workshop

2. Installing Python


Python is a popular language for scientific computing and a frequent choice for machine learning.

Python version requirement: This workshop requires Python 3.11.9. Newer versions like 3.12 or 3.13 are not yet fully compatible with TensorFlow and may cause issues. Even Python 3.11.9 may have some edge cases, but it works well enough to be the default in Google Colab and is stable for the purposes of this workshop.

To install Python 3.11.9, go to the official 3.11.9 downloads page. Choose the installer that matches your operating system (Windows, macOS, or Linux).

Please set up your Python environment at least a day in advance of the workshop. If you run into issues with installation, contact the workshop organizers by email so you’re ready to begin on time.

Determine which python command to use for downstream setup steps

Different systems and Python installations (e.g., Anaconda, Git Bash, system Python, Windows Store, etc.) may register different command names. This quick check helps identify which one points to Python 3.11.9 on your machine.

Run the following in your terminal (Git Bash recommended for Windows users, Anaconda Prompt, or macOS/Linux shell):

python --version
py --version
python3 --version

Use whichever one returns Python 3.11.9 for the rest of the setup steps.

Example output:

OUTPUT

$ python --version
Python 3.11.9

$ py --version
Python 3.13.2

$ python3 --version
Python was not found...

In this case, use python throughout the remainder of the instructions.

If none of the commands return Python 3.11.9:

  • Download and install Python 3.11.9. On Windows, be sure to check “Add Python to PATH” during installation
  • If you’re on Windows using Anaconda Prompt, try using Git Bash instead.
  • Then re-run the checks above in a new terminal window

If you’re still stuck, ask the workshop organizers for help before proceeding.

3. Configure virtual environment


Open a terminal and run the following commands.

  1. Create a virtual environment called venv using the “venv” command:
# Use python3 or py instead if one of them points to 3.11.9.
python -m venv venv # 1st "venv" is commmand, 2nd venv is name of the virtual environment / folder

If you run the ls command from ~/Desktop/dl_workshop, you should see a new venv folder inside it

ls

OUTPUT

venv/
  1. Activate the newly created virtual environment:
source venv/bin/activate
venv\Scripts\activate

If you’re using Git Bash on Windows, you need to add the source command first.

source venv/Scripts/activate

Note: Remember that you need to activate your environment every time you restart your terminal, and before you launch Jupyter Lab!

  1. After activating the enviornment, upgrade pip. This is a good practice to follow when you first initialize your virtual environment (beforing installing additional packages). Pip is the package management system built into Python.Pip should be available in your system once you installed Python successfully.
 # remember: use python3 or py instead if it points to 3.11.9
python -m pip install --upgrade pip
  1. Install the required packages:

Follow the OS-specific instructions below. NOte that It may take 10-20 minutes to install everything.

 # Use python or py instead if one of them points to 3.11.9.
python3 -m pip install jupyter seaborn scikit-learn pandas tensorflow pydot

Note for MacOS users: there is a package tensorflow-metal which accelerates the training of machine learning models with TensorFlow on a recent Mac with a Silicon chip (M1/M2/M3). However, the installation is currently broken in the most recent version (as of January 2025), see the developer forum.

# Use py or python3 instead if one of them points to 3.11.9.
python -m pip install jupyter seaborn scikit-learn pandas tensorflow pydot 

Note: Tensorflow makes Keras available as a module too.

An optional challenge in episode 2 requires installation of Graphviz and instructions for doing that can be found by following this link.

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), make sure that you activated the virtual environment you created for this course, and type the command:

jupyter lab

Check your virtual software setup

To check whether all packages installed correctly, start a jupyter notebook in jupyter lab as explained above (with virtual environment activated). Run the following check to verify you have the right version of Python configured.

PYTHON

!python --version

If you don’t see 3.11.9, make sure your virtual environment was activated prior to launching Jupyter Lab.

OUTPUT

Python 3.11.9 

Then, run the following lines of code:

PYTHON

import tensorflow
print('Tensorflow version: ', tensorflow.__version__) # >= 2.12.0

import sklearn
print('sklearn version: ', sklearn.__version__) # >= 1.2.2

import seaborn
print('seaborn version: ', seaborn.__version__) # any version
 
import pandas
print('pandas version: ', pandas.__version__) # any 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.

4. Downloading the required datasets


Download the weather dataset prediction csv and Dollar street dataset (4 files in total). Create a subfolder in your workshop folder called data, ~/Desktop/dl_workshop/data, and move all 5 files to the data subfolder:

  • dl_workshop/data/weather_prediction_dataset_light.csv
  • dl_workshop/data/train_labels.npy
  • dl_workshop/data/test_labels.npy
  • dl_workshop/data/train_images.npy
  • dl_workshop/data/test_images.npy

Note: If you end up using Google Colab for the workshop, you’ll want to create a folder called dl_workshop within your Google drive, and then create the same data subfolder as above with all 5 files uploaded. Avoid uploading the venv folder to your google drive; you’ll be using Colab’s pre-built environment instead, and the venv folder contains MANY files from the libraries you installed.

You can access files from Google drive using Colab and the following code:

PYTHON

from google.colab import drive
drive.mount('/content/drive')

A prompt will appear asking you to authorize access to your Google Drive. After authorization, your Drive will be accessible under /content/drive/My Drive/. You can use standard Python I/O or libraries like pandas, os, glob, etc. to interact with files. Example below:

PYTHON

import pandas as pd
# Load a CSV file from Drive
df = pd.read_csv('/content/drive/My Drive/dl_workshop/data/weather_prediction_dataset_light.csv')

You can use the file navigator (folder icon) within Colab to help navigate your Google drive files.