本文整理汇总了Python中baselines.deepq.build_train方法的典型用法代码示例。如果您正苦于以下问题:Python deepq.build_train方法的具体用法?Python deepq.build_train怎么用?Python deepq.build_train使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类baselines.deepq
的用法示例。
在下文中一共展示了deepq.build_train方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from baselines import deepq [as 别名]
# 或者: from baselines.deepq import build_train [as 别名]
def __init__(self,
model,
observation_space,
n_actions,
gamma,
lr,
replay_buffer,
batch_size,
optim_iters,
grad_norm_clip,
double_q
):
self.replay_buffer = replay_buffer
self.batch_size = batch_size
self.optim_iters = optim_iters
optimizer = tf.train.AdamOptimizer(learning_rate=lr)
def make_obs_ph(name):
return ObservationInput(observation_space, name=name)
self.act, self.train, self.update_target, _ = deepq.build_train(
make_obs_ph=make_obs_ph,
q_func=model,
num_actions=n_actions,
optimizer=optimizer,
gamma=gamma,
grad_norm_clipping=grad_norm_clip,
double_q=double_q
)