对 5-2 进行修改,加入放映器(projector)实现分类过程中图片可视化
例子
1 | import tensorflow as tf |
1 | #载入数据集 |
Extracting MNIST_data\train-images-idx3-ubyte.gz
Extracting MNIST_data\train-labels-idx1-ubyte.gz
Extracting MNIST_data\t10k-images-idx3-ubyte.gz
Extracting MNIST_data\t10k-labels-idx1-ubyte.gz
1 | # STEP 1 设计统计函数,用于计算传入的张量的各种统计量 |
1 | ''' DEL 这次数据集很大,不计算批次数,而是自己指定 batch_num 即 max_steps |
step:0, accuracy:0.1275
step:3, accuracy:0.3143
step:6, accuracy:0.5248
step:9, accuracy:0.5986
step:12, accuracy:0.6266
step:15, accuracy:0.6751
step:18, accuracy:0.6905
step:21, accuracy:0.7041
step:24, accuracy:0.7387
step:27, accuracy:0.747
step:30, accuracy:0.7538
总结
输入下面代码运行
tensorboard --logdir=D:/Tensorflow/projector/projector
可以在 Tensorboard 的 IMAGES 和 EMBEDDINGS 选项卡查看新效果
效果如图: