Added tutorial and fixed bug in train.py.