Further lecture times: See time table below. From now on, we will always be in lecture hall G.

EXAM: Written exam August 9th, 10:00-12:00. Lecture hall D. Please be there a few minutes earlier! During the exam, one A4 page of notes (handwritten by yourself, both sides if needed) is allowed, but nothing more.

REPEAT EXAM: Written exam, Wednesday, October 11, 10:00-12:00. Lecture hall B. Please be there a few minutes earlier! During the exam, one A4 page of notes (handwritten by yourself, both sides if needed) is allowed, but nothing more.

Description: This is a course introducing modern techniques of machine learning, especially deep neural networks, to an audience of physicists. Neural networks can be trained to perform many challenging tasks, including image recognition and natural language processing, just by showing them many examples. While neural networks have been introduced already in the 50s, they really have taken off in the past decade, with spectacular successes in many areas. Often, their performance now surpasses humans, as proven by the recent achievements in handwriting recognition and in winning the game of 'Go' against expert human players. They are now also being considered more and more for applications in physics, ranging from predictions of material properties to analyzing phase transitions.

Contents: We will cover the basics of neural networks (backpropagation), convolutional networks, autoencoders, restricted Boltzmann machines, and recurrent neural networks, as well as the recently emerging applications in physics. Time permitting, we will address other topics, like the relation to spin glass models, curriculum learning, reinforcement learning, adversarial learning, active learning, "robot scientists", deducing nonlinear dynamics, and dynamical neural computers.

Prerequisites: As a prerequisite you will only need matrix multiplication and the chain rule, i.e. the course will be understandable to bachelor students, master students and graduate students. However, knowledge of any computer programming language will make it much more fun. We will sometimes present examples using the 'python' programming language, which is a modern interpreted language with powerful linear algebra and plotting functions.

Software: Modern standard computers are powerful enough to run neural networks in a reasonable time. The following list of software packages helps to keep the programming effort low (it is possible to implement advanced structures like a deep convolutional neural network in only a dozen lines of code, which is quite amazing):

Python is a widely used high-level programming language for general-purpose programming; both Theano and Keras are Python moduls. We highly recommend the usage of the 3.x branch (cmp. Python2 vs Python3).

Theano is a numerical computation library for Python. In Theano, computations are expressed using a NumPy-like syntax and compiled to run efficiently on either CPU or GPU architectures. Therefore, Theano provides the low-level tools (multi-dimensional arrays, convolutional layers, efficient computation of the gradient, ...) needed to implement artificial neural networks.

Keras is a high-level framework for neural networks, running on top of Theano. Designed to enable fast experimentation with deep neural networks, it focuses on being minimal, modular and extensible.

Matplotlib is a plotting library for the Python programming language. We use it to visualize our results.

Jupyter is a browser-based application that allows to create and share documents that contain live (Python) code, equations, visualizations and explanatory text. So, Jupyter serves a similar purpose like Mathematica notebooks.

All the software above is open source and freely available for a large number of platforms. See also the Installation instructions section below.

Jupyter Notebook for backpropagation and example (as in the lecture; Note: After downloading, in some browsers, you may have to remove the ending ".txt", such that the file has the ending ".ipynb"; then use "jupyter notebook" and open the file!)

Preliminary Schedule

Installation instructions

The following instructions should be quite detailed and easy to follow. If you nevertheless encounter a problem which you cannot solve for yourself, please write an email to Thomas Foesel.

Note: the monospaced text in this section are commands which have to be executed in a terminal.

for Linux/Mac: The terminal is simply the system shell. The "#" at the start of the line indicates that root privileges are required (so log in as root via su, or use sudo if this is configured suitably), whereas the commands starting with "$" can be executed as a normal user.

for Windows: Type the commands into the Conda terminal which is part of the Miniconda installation (see below).

Installing Python, Theano, Keras, Matplotlib and Jupyter

In the following, we show how to install these packages on the three common operating systems. There might be alternative ways to do so; if you prefer another one that works for you, this is also fine, of course.

Download the installation script for the Miniconda collection (make sure to select Python 3.x, the upper row). In the terminal, go into the directory of this file ($ cd ...) and run # bash Miniconda3-latest-MacOSX-x86_64.sh.

Because there are more recent Conda versions than on the website, update it via conda update conda.

Create a Conda environment with $ conda create --name neuralnets python=3.5 (note that keras does not run on python 3.6 yet) and activate it via $ source activate neuralnets.

Configuration: protecting Jupyter

Important: If you intend to run Jupyter on a multi-user system (like the CIP pool), it is absolutely necessary to protect it against arbitrary code execution by other users. The instructions can be found here.

Configuration: tell Keras to use the Theano backend

Load Keras into Python (this command will probably fail as it tries to load TensorFlow, but this is OK. Its purpose is to initialize the ".keras" folder):

on Linux: $ python3 -c "import keras"

on Mac: $ source activate neuralnets; python -c "import keras"

on Windows:activate neuralnetspython -c "import keras"

edit file ".keras/keras.json" in your home directory: replace "tensorflow" with "theano". To do that,

on Linux/Mac: open file "~/.keras/keras.json" in your home directory with your preferred text editor (either with command line editors like $ vi ~/.keras/keras.json, $ emacs ~/.keras/keras.json and $ nano ~/.keras/keras.json, or any graphical text editor)

In the same way, you should also be able to execute your own Python scripts. If you call $ python3/$ python/python.exe without an argument, an interactive session is started, i.e. you can directly enter Python commands into the terminal.

In addition, you should be able to start a Jupyter notebook via $ jupyter notebook (will automatically open a browser tab where you can work).