这里是LeeTioN的博客
前言
本篇文章是针对GitHub上的一个TensorFlow实例来进行源码讲解和分析
Esitmator简介
Esitmator是用来封装网络模型和参数的类,它的父类estimator(小写字母e)的其它子类有线性回归和分类等其他经典模型,而Esitmator用于构造自定义网络模型。
Estimator定义和传参方式
在Estimator中我们需要一个model_fn函数来自定义我们的网络,同时规定好features, labels和mode(可选模式,train, predition, evaluate)三个参数。
def model_fn(features, label, mode):
……
model = tf.estimator.Estimator(model_fn)
model.train(input_fn, steps=num_steps)
但是在model.train()函数并没有看到以上三个参数的传入,