TensorFlow学习笔记-tf.estimator
2018-02-20 18:53
453 查看
tfestimatorEstimator
属性
方法
传入
model_dir
model_fn
The model_fn with following signature:
params
对训练模型评价
导出inference graph作为一个SavedModel
get_variable_names
get_variable_names()
返回模型中所有变量名字的列表
get_variable_value(name)
根据变量name返回value
latest_checkpoint()
在
predict
根据给定的features产生预测
train
给定训练数据后训练model
属性
方法
tf.estimator.Estimator
Estimator class训练和测试TF模型。Estimator对象封装好通过
model_fn指定的模型,给定输入和其它超参数,返回ops执行training, evaluation or prediction. 所有的输出(包含checkpoints, event files, etc.)被写入
model_dir。
属性
config传入
model_fn,如果
model_fn有参数named “config”
model_dir
model_fn
The model_fn with following signature:
def model_fn(features, labels, mode, config)
params
方法
__init__
__init__( model_fn, model_dir=None, config=None, params=None # 将要传入model_fn的超参数字典 )
evaluate
对训练模型评价
evaluate( input_fn, # 输入函数,返回元组features和labels steps=None, hooks=None, # List of SessionRunHook subclass instances checkpoint_path=None, # if none, 用model_dir中latest checkpoint name=None )
export_savemodel
导出inference graph作为一个SavedModel
export_savedmodel( export_dir_base, # 目录 serving_input_receiver_fn, # 返回ServingInputReceiver的函数 assets_extra=None, as_text=False, checkpoint_path=None )
get_variable_names
get_variable_names()
返回模型中所有变量名字的列表
get_variable_value(name)
根据变量name返回value
latest_checkpoint()
在
model_dir中找到最近保存的checkpoint
predict
根据给定的features产生预测
predict( input_fn, predict_keys=None, hooks=None, checkpoint_path=None )
train
给定训练数据后训练model
train( input_fn, hooks=None, steps=None, max_steps=None, saving_listeners=None )
相关文章推荐
- TensorFlow学习笔记(十六)tf.random_normal
- 机器学习笔记5-Tensorflow高级API之tf.estimator
- TensorFlow学习笔记 速记1——tf.nn.dropout
- 学习笔记TF024:TensorFlow实现Softmax Regression(回归)识别手写数字
- 学习笔记TF048:TensorFlow 系统架构、设计理念、编程模型、API、作用域、批标准化、神经元函数优化
- 3. Tensorflow学习笔记之tf.placeholder函数
- TensorFlow学习笔记之tf.nn.softmax()与tf.nn.softmax_cross_entropy_with_logits的用法
- TensorFlow学习笔记6----tf.contrib.learn Quickstart
- 深度学习笔记——深度学习框架TensorFlow(八)[Logging and Monitoring Basics with tf.contrib.learn]
- 学习笔记TF066:TensorFlow移动端应用,iOS、Android系统实践
- TensorFlow学习笔记12----Creating Estimators in tf.contrib.learn
- Tensorflow学习笔记之用TF读取csv文件的限制
- Tensorflow实战学习(四十二)【TF.Learn、分布式Estimator、深度学习Estimator】
- 学习笔记TF045:人工智能、深度学习、TensorFlow、比赛、公司
- tensorflow学习笔记--tf.one_hot
- 深度学习笔记——深度学习框架TensorFlow(十)[Creating Estimators in tf.contrib.learn]
- TensorFlow学习笔记10----Logging and Monitoring Basics with tf.contrib.learn
- 学习笔记TF049:TensorFlow 模型存储加载、队列线程、加载数据、自定义操作
- tensorflow学习笔记十四:tensorflow中的tf.app.run()
- TensorFlow学习笔记8:CNN搭建(layer,estimator等)