Neural Networks – 2017/2018

Older editions: 2012 – 2013/2014 – 2016/2017


This page contains the material for the lab sessions that I hold in the Neural Networks course taught by Prof. Aurelio Uncini for the M.Sc. in Artificial Intelligence and Robotics. For general informations about the course please refer to the original web pages.


All lab sessions require a working installation of Python 3.5 (or higher) with (at least) Jupyter, NumPy, matplotlib, and scikit-learn (for the second and third labs). If you are starting from scratch, installing the Anaconda platform is the recommended method to have a working installation with all prerequisites. Alternatively, Canopy offers a working license by registering with the academic email. If you prefer a minimal installation, after installing Python and the pip module to manage libraries (e.g., following this guide on Ubuntu systems), you can install all prerequisites by running the following command on the console:

Lab session 1 – Python & NumPy

Download the code for this lab

This lab session aims at gaining some familiarity with Python, NumPy (for linear algebra), and SciPy.

Lab session 2 – Linear regression and classification

Download the code for this lab

This lab session has two main notebooks:

  1. Linear regression in NumPy with artificial data.
  2. Logistic regression using the AutoGrad library for automatic gradient computation.

Lab session 3 – Neural network with Autograd

Download the code for this lab

In this lab session, we implemented a simple feedforward neural network for a multi-class classification problem using the Autograd library.