学习mnist.py— 构建图表
跟着教程步骤将代码打一遍,这样更容易记住。
Builds the MNIST network.
Implements the inference/loss/training pattern for model building.
- inference() — Builds the model as far as required for running the network
forward to make predictions. - loss() — Adds to the inference model the layers required to generate loss.
- training() — Adds to the loss model the Ops required to generate and
apply gradients.
1 | import math |
学习fully_connected_feed.py— 训练模型
上一节的mnist.py起到构建图表的作用。一旦图表构建完毕,就通过fully_connected_feed.py文件中的用户代码进行循环地迭代式训练和评估。
Trains and Evaluates the MNIST network using a feed dictionary.
1 | import argparse |