训练模型的基本循环。
用法
tf.compat.v1.train.basic_train_loop(
supervisor, train_step_fn, args=None, kwargs=None, master=''
)
参数
-
supervisor
tf.compat.v1.train.Supervisor
运行训练服务。 -
train_step_fn
可调用以执行一个训练步骤。反复调用train_step_fn(session, *args **kwargs)
。 -
args
传递给train_step_fn
的可选位置参数。 -
kwargs
传递给train_step_fn
的可选关键字参数。 -
master
用于创建训练课程的大师。默认为""
,这会导致在本地进程中创建会话。
在循环中调用train_step_fn
来训练模型。该函数被称为:
train_step_fn(session, *args, **kwargs)
除了 args
和 kwargs
之外,它还传递了 tf.compat.v1.Session
。该函数通常在会话中运行一个训练步骤。
相关用法
- Python tf.compat.v1.train.FtrlOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.train.get_or_create_global_step用法及代码示例
- Python tf.compat.v1.train.cosine_decay_restarts用法及代码示例
- Python tf.compat.v1.train.Optimizer用法及代码示例
- Python tf.compat.v1.train.AdagradOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.train.init_from_checkpoint用法及代码示例
- Python tf.compat.v1.train.Checkpoint用法及代码示例
- Python tf.compat.v1.train.Supervisor.managed_session用法及代码示例
- Python tf.compat.v1.train.Checkpoint.restore用法及代码示例
- Python tf.compat.v1.train.global_step用法及代码示例
- Python tf.compat.v1.train.MonitoredSession.run_step_fn用法及代码示例
- Python tf.compat.v1.train.RMSPropOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.train.exponential_decay用法及代码示例
- Python tf.compat.v1.train.natural_exp_decay用法及代码示例
- Python tf.compat.v1.train.MomentumOptimizer用法及代码示例
- Python tf.compat.v1.train.RMSPropOptimizer用法及代码示例
- Python tf.compat.v1.train.get_global_step用法及代码示例
- Python tf.compat.v1.train.GradientDescentOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.train.linear_cosine_decay用法及代码示例
- Python tf.compat.v1.train.Supervisor用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.compat.v1.train.basic_train_loop。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。