浏览代码

Fix policy's scoping

/develop/nopreviousactions
Ervin Teng 5 年前
当前提交
1f094da9
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 9
      ml-agents/mlagents/trainers/common/nn_policy.py

9
ml-agents/mlagents/trainers/common/nn_policy.py


"""
Builds the tensorflow graph needed for this policy.
"""
with tf.variable_scope("policy/"):
self.create_input_placeholders()
with self.graph.as_default():
with self.graph.as_default():
with tf.variable_scope("policy"):
self.create_input_placeholders()
if self.use_continuous_act:
self.create_cc_actor(
self.h_size,

h_size,
num_layers,
vis_encode_type,
stream_scopes=["policy/"],
)[0]
if self.use_recurrent:

hidden_policy,
self.act_size[0],
activation=None,
name="mu",
kernel_initializer=LearningModel.scaled_init(0.01),
reuse=tf.AUTO_REUSE,
)

h_size,
num_layers,
vis_encode_type,
stream_scopes=["policy/"],
)[0]
if self.use_recurrent:

正在加载...
取消
保存