当前位置: 首页>>代码示例>>Python>>正文


Python model.dueling_model方法代码示例

本文整理汇总了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) 
开发者ID:StephanZheng,项目名称:neural-fingerprinting,代码行数:21,代码来源:enjoy-adv.py

示例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) 
开发者ID:behzadanksu,项目名称:rl-attack,代码行数:20,代码来源:enjoy-adv.py

示例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) 
开发者ID:tensorflow,项目名称:cleverhans,代码行数:21,代码来源:enjoy-adv.py

示例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 
开发者ID:StephanZheng,项目名称:neural-fingerprinting,代码行数:14,代码来源:enjoy-adv.py

示例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 
开发者ID:behzadanksu,项目名称:rl-attack,代码行数:13,代码来源:enjoy-adv.py

示例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 
开发者ID:tensorflow,项目名称:cleverhans,代码行数:14,代码来源:enjoy-adv.py


注:本文中的model.dueling_model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。