訓練模型的基本循環。
用法
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。