Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo mxnet #116

Merged
merged 10 commits into from
Jan 13, 2018
Merged

demo mxnet #116

merged 10 commits into from
Jan 13, 2018

Conversation

daming-lu
Copy link
Collaborator

No description provided.

# 引入VisualDL
from visualdl import LogWriter

# 下载MNIST数据集
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to english

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

acc = mx.metric.Accuracy()
lenet_model.score(test_iter, acc)
print(acc)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use pylint to style python code.

## 开始编写训练MNIST的程序

我们为您提供了一个演示程序 [mxnet_demo.py](./mxnet_demo.py)。里面展示了如何下载MNIST数据集以及编写MXNet程序来进行CNN的训练。MXNet的部分借鉴了MXNet[官方入门文件](https://mxnet.incubator.apache.org/tutorials/python/mnist.html)
为了嵌入VisualDL程序,以便在MXNet训练时进行检测,我们需要声明一个logger实例:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger => log writer

logger = LogWriter(logdir, sync_cycle=10)
```

logger实例里面包含VisualDL的四个功能模块 Scalar, Image, Graph 以及 Histogram。这里我们使用 Scalar 模块:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有graph模块

Copy link
Contributor

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daming-lu daming-lu merged commit 9867588 into PaddlePaddle:develop Jan 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants