关于Estimator

关于自定义模型(estimator)的使用介绍,下面文章里写的很详细,不再重复。

https://blog.csdn.net/amao1998/article/details/80202777

关于自定义模型函数的参数问题,之前一直不是很懂,原因是固定参数。
看了下Estimator的代码,里面会自动解释赋值。

def model_fn(
   features, # 本批次的特征数据
   labels,   # 本批次的标记数据
   mode,     # tf.estimator.ModeKeys的一个实例,用以表示是要训练,评估,还是预测
   params):  # 模型额外参数

另外,

现在的Tensorflow有两个Estimator的API,功能类似,一直有疑惑,终于查到,tf.contrib.learn.Estimator为不推荐使用,以后的版本里应该会废除掉。

  • tf.contrib.learn.Estimator
  • tf.estimator.Estimator

参考 :https://www.tensorflow.org/guide/estimators

Note: TensorFlow also includes a deprecated Estimator class at tf.contrib.learn.Estimator, which you should not use.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值