Deep Learning course @ fast.ai
∞This course is a very practical introduction to deep learning. It is focused on writing code and achieving state of the art results. Intended as a 7-week course, each lecture presents a different “end-to-end” project. For example, the first lecture implements a full image classification task, deciding whether a picture has a dog or a cat.
Some characteristics:
- approachable for “non-math” people (and in the future non-programmers)
- state of the art results
- self-contained projects each week
- better understanding by discouraging copying and pasting
each week is provided as a notebook
Intended to be read, and it is recommended to then try writing it out all on your own, only referencing the notebook when stuck. This way developing own intuitions and actively learning the material.
Notes for the first lecture
The code from the lecture uses an existing pre-trained model for the ImageNet dataset to create a classifier that is able to classify arbitrary user-specified categories.
The lecture uses a dataset from Kaggle, an algorithm competition platform, but that’s just one way to get a dataset with suitable pictures. (Kaggle is a pain to set up, because they are afraid that people cheat on their competitions. To get the dataset you have to get an account, agree to the rules of the dogs-vs-cats competition there, and give them your phone number so that they can send you a verification SMS.)
the lecture uses a very specific directory layout:
data/ <name-of-dataset>/ train/ <category1>/ <img1.jpg> ... <category2>/ ... <more categories...> valid/ <layout same as train/...>
For example, if you want to distinguish between cats and dogs, you’d have a layout like this:
data/ cats-vs-dogs/ train/ cat/ (images of cats here) dog/ (images of dogs here) valid/ cat/ dog/
How to get a development environment
The course seemingly requires a computer with an Nvidia GPU, and suggests to use an AWS instance, but you can run everything locally:
install anaconda2 & dependencies (requires ~2.5gb of disk space):
# install anaconda somewhere $ curl -o anaconda2-4.3.1.sh https://repo.continuum.io/archive/Anaconda2-4.3.1-Linux-x86_64.sh $ sh anaconda2-4.3.1.sh --prefix $HOME/code/anaconda2 $ export PATH=$HOME/code/anaconda2/bin:$PATH # install dependencies $ conda install -y bcolz $ conda update -y --all $ pip install theano $ pip install keras=1.2.2
- if
conda
can’t install things, you might have to update the requests library first:pip install -U requests
- if
configure keras to use theano:
$ cat <<EOF > $HOME/.keras/keras.json { "image_dim_ordering": "th", "epsilon": 1e-07, "floatx": "float32", "backend": "theano" } EOF
if you have GCC6 or later, you need to install and configure theano to use GCC5:
$ sudo pacman -S gcc5 $ cat <<EOF > $HOME/.theanorc [global] cxx=/usr/bin/g++-5 EOF