TensorFlow 便捷的实现机器学习 三
TensorFlow 便捷的实现机器学习 三
MNIST 卷积神经网络 Fly
- Overview
- Enabling Logging with TensorFlow
- Configuring a ValidationMonitor for Streaming Evaluation
- Evaluating Every N Steps
- Customizing the Evaluation Metrics
- Early Stopping with ValidationMonitor
- Visualizing Log Data with TensorBoard
- reference
Iris花瓣分类中,运行结果后,我们最后只是知道一个最终的结果:
Accuracy: 0.933333
Predictions: [1 2]
我们并不能知道tensorflow执行的过程中发生了写什么。
有一种方式是通过在训练过程中通过多次fit来一步一步的得到结果,但是这种方式会大大的影响执行效率。我们可以使用==tf.contrib.learn提供的Monitor API工具来实现监控。下面主要学习的时候启动Logging一级TensorBoard来对实现过程做一个监控。
这样子在运行程序的话,就会看到如下信息:
INFO:tensorflow:Training steps [0,200)
INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:Step 1: loss_1:0 = 1.48073
INFO:tensorflow:training step 100, loss = 0.19847 (0.001 sec/batch).
INFO:tensorflow:Step 101: loss_1:0 = 0.192693
INFO:tensorflow:Step 200: loss_1:0 = 0.0958682
INFO:tensorflow:training step 200, loss = 0.09587 (0.003 sec/batch).
https://www.tensorflow.org/tutorials/monitors/