This tutorial introduces the programming language Julia and the Knet deep learning framework. By the end, the reader should be able to define, train, evaluate, and visualize basic MLP, CNN, and RNN models. Each notebook is written to work stand-alone but they rely on concepts introduced in earlier notebooks, so I recommend reading them in order. Every Knet function outside of the standard Julia library is defined or explained before use.
To run the notebooks on your computer, install and run IJulia by typing the following at the
julia>
prompt (see IJulia.jl for more
information):
julia> using Pkg; Pkg.add("IJulia"); Pkg.add("Knet")
julia> using IJulia, Knet
julia> notebook(dir=Knet.dir("tutorial"))
To run the notebooks in the cloud you can use JuliaBox, Google
Colab, or services like
AWS. To run on JuliaBox, click the Git button in the Dashboard and
clone https://github.com/denizyuret/Knet.jl.git
. The tutorial should be available under
Knet/tutorial
on the Jupyter screen. To run on Colab add Julia support first using the
JuliaOnColab.ipynb notebook, then open the notebooks in
Google
Drive.
To run on AWS follow the instructions in the Knet Installation
Section.
Contents:
- Julia is fast: comparison of Julia's speed to C, Python and numpy.
- Getting to know Julia: basic Julia tutorial from JuliaBox.
- Quick start: if you are familiar with other deep learning frameworks and want to see a quick Julia example.
- The MNIST dataset: introduction to the MNIST handwritten digit recognition dataset.
- Julia iterators: iterators are useful for generating and training with data.
- Creating a model: define, train, visualize simple linear models, introduce gradients, SGD, using the GPU.
- Multilayer perceptrons: multi layer perceptrons, nonlinearities, model capacity, overfitting, regularization, dropout.
- Convolutional networks: convolutional neural networks, sparse and shared weights using conv4 and pool operations.
- Recurrent networks: introduction to recurrent neural networks.
- IMDB sentiment analysis: a simple RNN sequence classification model for sentiment analysis of IMDB movie reviews.
- Language modeling: a character based RNN language model that can write Shakespeare sonnets and Julia programs.
- Sequence to sequence: a sequence to sequence RNN model typically used for machine translation.