本文整理汇总了Python中model.dueling_model方法的典型用法代码示例。如果您正苦于以下问题:Python model.dueling_model方法的具体用法?Python model.dueling_model怎么用?Python model.dueling_model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model.dueling_model方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import model [as 别名]
# 或者: from model import dueling_model [as 别名]
def __init__(self, env, dueling, noisy, fname):
self.g = tf.Graph()
self.noisy = noisy
self.dueling = dueling
self.env = env
with self.g.as_default():
self.act = deepq.build_act_enjoy(
make_obs_ph=lambda name: U.Uint8Input(
env.observation_space.shape, name=name),
q_func=dueling_model if dueling else model,
num_actions=env.action_space.n,
noisy=noisy
)
self.saver = tf.train.Saver()
self.sess = tf.Session(graph=self.g)
if fname is not None:
print('Loading Model...')
self.saver.restore(self.sess, fname)
示例2: __init__
# 需要导入模块: import model [as 别名]
# 或者: from model import dueling_model [as 别名]
def __init__(self, env, dueling, noisy, fname):
self.g = tf.Graph()
self.noisy = noisy
self.dueling = dueling
self.env = env
with self.g.as_default():
self.act = deepq.build_act_enjoy(
make_obs_ph=lambda name: U.Uint8Input(env.observation_space.shape, name=name),
q_func=dueling_model if dueling else model,
num_actions=env.action_space.n,
noisy=noisy
)
self.saver = tf.train.Saver()
self.sess = tf.Session(graph=self.g)
if fname is not None:
print ('Loading Model...')
self.saver.restore(self.sess, fname)
示例3: __init__
# 需要导入模块: import model [as 别名]
# 或者: from model import dueling_model [as 别名]
def __init__(self, env, dueling, noisy, fname):
self.g = tf.Graph()
self.noisy = noisy
self.dueling = dueling
self.env = env
with self.g.as_default():
self.act = deepq.build_act_enjoy(
make_obs_ph=lambda name: U.Uint8Input(
env.observation_space.shape, name=name),
q_func=dueling_model if dueling else model,
num_actions=env.action_space.n,
noisy=noisy
)
self.saver = tf.train.Saver()
self.sess = tf.Session(graph=self.g)
if fname is not None:
print('Loading Model...')
self.saver.restore(self.sess, fname)
示例4: craft_adv
# 需要导入模块: import model [as 别名]
# 或者: from model import dueling_model [as 别名]
def craft_adv(self):
with self.sess.as_default():
with self.g.as_default():
craft_adv_obs = deepq.build_adv(
make_obs_tf=lambda name: U.Uint8Input(
self.env.observation_space.shape, name=name),
q_func=dueling_model if self.dueling else model,
num_actions=self.env.action_space.n,
epsilon=1.0 / 255.0,
noisy=self.noisy,
)
return craft_adv_obs
示例5: craft_adv
# 需要导入模块: import model [as 别名]
# 或者: from model import dueling_model [as 别名]
def craft_adv(self):
with self.sess.as_default():
with self.g.as_default():
craft_adv_obs = deepq.build_adv(
make_obs_tf=lambda name: U.Uint8Input(self.env.observation_space.shape, name=name),
q_func=dueling_model if self.dueling else model,
num_actions=self.env.action_space.n,
epsilon = 1.0/255.0,
noisy=self.noisy,
)
return craft_adv_obs
示例6: craft_adv
# 需要导入模块: import model [as 别名]
# 或者: from model import dueling_model [as 别名]
def craft_adv(self):
with self.sess.as_default():
with self.g.as_default():
craft_adv_obs = deepq.build_adv(
make_obs_tf=lambda name: U.Uint8Input(
self.env.observation_space.shape, name=name),
q_func=dueling_model if self.dueling else model,
num_actions=self.env.action_space.n,
epsilon=1.0 / 255.0,
noisy=self.noisy,
)
return craft_adv_obs