本文整理匯總了Python中baselines.deepq.replay_buffer.PrioritizedReplayBuffer方法的典型用法代碼示例。如果您正苦於以下問題:Python replay_buffer.PrioritizedReplayBuffer方法的具體用法?Python replay_buffer.PrioritizedReplayBuffer怎麽用?Python replay_buffer.PrioritizedReplayBuffer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類baselines.deepq.replay_buffer
的用法示例。
在下文中一共展示了replay_buffer.PrioritizedReplayBuffer方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from baselines.deepq import replay_buffer [as 別名]
# 或者: from baselines.deepq.replay_buffer import PrioritizedReplayBuffer [as 別名]
def __init__(self, sess):
print("Initializing the agent...")
self.sess = sess
self.env = Environment()
self.state_size = self.env.get_state_size()[0]
self.action_size = self.env.get_action_size()
self.low_bound, self.high_bound = self.env.get_bounds()
self.buffer = PrioritizedReplayBuffer(parameters.BUFFER_SIZE,
parameters.ALPHA)
print("Creation of the actor-critic network...")
self.network = Network(self.state_size, self.action_size,
self.low_bound, self.high_bound)
print("Network created !\n")
self.epsilon = parameters.EPSILON_START
self.beta = parameters.BETA_START
self.best_run = -1e10
self.sess.run(tf.global_variables_initializer())
示例2: __init__
# 需要導入模塊: from baselines.deepq import replay_buffer [as 別名]
# 或者: from baselines.deepq.replay_buffer import PrioritizedReplayBuffer [as 別名]
def __init__(self, sess):
print("Initializing the agent...")
self.sess = sess
self.env = Environment()
self.state_size = self.env.get_state_size()
self.action_size = self.env.get_action_size()
print("Creation of the main QNetwork...")
self.mainQNetwork = QNetwork(self.state_size, self.action_size, 'main')
print("Main QNetwork created !\n")
print("Creation of the target QNetwork...")
self.targetQNetwork = QNetwork(self.state_size, self.action_size,
'target')
print("Target QNetwork created !\n")
self.buffer = PrioritizedReplayBuffer(parameters.BUFFER_SIZE,
parameters.ALPHA)
self.epsilon = parameters.EPSILON_START
self.beta = parameters.BETA_START
self.initial_learning_rate = parameters.LEARNING_RATE
trainables = tf.trainable_variables()
self.update_target_ops = updateTargetGraph(trainables)
self.nb_ep = 1
self.best_run = -1e10
示例3: __init__
# 需要導入模塊: from baselines.deepq import replay_buffer [as 別名]
# 或者: from baselines.deepq.replay_buffer import PrioritizedReplayBuffer [as 別名]
def __init__(self, sess):
print("Initializing the agent...")
self.sess = sess
self.env = Environment()
self.state_size = self.env.get_state_size()
self.action_size = self.env.get_action_size()
print("Creation of the main QNetwork...")
self.mainQNetwork = QNetwork(self.state_size, self.action_size, 'main')
print("Main QNetwork created !\n")
print("Creation of the target QNetwork...")
self.targetQNetwork = QNetwork(self.state_size, self.action_size,
'target')
print("Target QNetwork created !\n")
self.buffer = PrioritizedReplayBuffer(parameters.BUFFER_SIZE,
parameters.ALPHA)
self.epsilon = parameters.EPSILON_START
self.beta = parameters.BETA_START
trainables = tf.trainable_variables()
self.update_target_ops = updateTargetGraph(trainables)
self.nb_ep = 1