當前位置: 首頁>>代碼示例>>Python>>正文


Python replay_buffer.PrioritizedReplayBuffer方法代碼示例

本文整理匯總了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()) 
開發者ID:SuReLI,項目名稱:Deep-RL-agents,代碼行數:25,代碼來源:Agent.py

示例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 
開發者ID:SuReLI,項目名稱:Deep-RL-agents,代碼行數:32,代碼來源:Agent.py

示例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 
開發者ID:SuReLI,項目名稱:Deep-RL-agents,代碼行數:29,代碼來源:Agent.py


注:本文中的baselines.deepq.replay_buffer.PrioritizedReplayBuffer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。