Move learning_rate to train

Note that this also includes changes from pull request #3.