update
This commit is contained in:
@@ -5,7 +5,7 @@ Author: John
|
||||
Email: johnjim0816@gmail.com
|
||||
Date: 2021-03-23 15:30:46
|
||||
LastEditor: John
|
||||
LastEditTime: 2021-03-23 15:30:55
|
||||
LastEditTime: 2021-09-26 22:00:07
|
||||
Discription:
|
||||
Environment:
|
||||
'''
|
||||
@@ -24,14 +24,9 @@ class PPOMemory:
|
||||
indices = np.arange(len(self.states), dtype=np.int64)
|
||||
np.random.shuffle(indices)
|
||||
batches = [indices[i:i+self.batch_size] for i in batch_step]
|
||||
return np.array(self.states),\
|
||||
np.array(self.actions),\
|
||||
np.array(self.probs),\
|
||||
np.array(self.vals),\
|
||||
np.array(self.rewards),\
|
||||
np.array(self.dones),\
|
||||
batches
|
||||
|
||||
return np.array(self.states),np.array(self.actions),np.array(self.probs),\
|
||||
np.array(self.vals),np.array(self.rewards),np.array(self.dones),batches
|
||||
|
||||
def push(self, state, action, probs, vals, reward, done):
|
||||
self.states.append(state)
|
||||
self.actions.append(action)
|
||||
|
||||
Reference in New Issue
Block a user