Skip to content

Commit

Permalink
Fix linear regression tutorial (apache#6978)
Browse files Browse the repository at this point in the history
* Fix linear regression tutorial

- Print training logs in notebook.
- Switch from accuracy to mse for validation metrics. Accuracy doesn't make much sense for regression.
- Lower the number of epochs to 50. Number of epochs in unnecessarily huge (1000) consuming too much time. Training converges in around 30 epochs.

* Fix indentation.
  • Loading branch information
indhub authored and madjam committed Jul 10, 2017
1 parent caa3759 commit 88818cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/tutorials/python/linear-regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ To begin, the following code imports the necessary packages we'll need for this
```python
import mxnet as mx
import numpy as np

import logging
logging.getLogger().setLevel(logging.DEBUG)
```

## Preparing the Data
Expand Down Expand Up @@ -153,7 +156,8 @@ parameters of the model to fit the training data. This is accomplished using the
```python
model.fit(train_iter, eval_iter,
optimizer_params={'learning_rate':0.005, 'momentum': 0.9},
num_epoch=1000,
num_epoch=50,
eval_metric='mse',
batch_end_callback = mx.callback.Speedometer(batch_size, 2))
```

Expand Down

0 comments on commit 88818cd

Please sign in to comment.