[rllib] A3C Refactoring (#1166)

* fixing policy

* Compute Action is singular, fixed weird issue with arrays

* remove vestige

* extraneous ipdb

* Can Drop in Pytorch Model

* lint

* naming

* finish comments
This commit is contained in:
Richard Liaw
2017-10-29 11:12:17 -07:00
committed by GitHub
parent 4cace0976d
commit dc66a2d7d5
12 changed files with 401 additions and 341 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ We use a Ray Actor to simulate the environment.
self.policy.set_weights(params)
rollout = self.pull_batch_from_queue()
batch = process_rollout(rollout, gamma=0.99, lambda_=1.0)
gradient = self.policy.get_gradients(batch)
gradient = self.policy.compute_gradients(batch)
info = {"id": self.id,
"size": len(batch.a)}
return gradient, info
@@ -138,7 +138,7 @@ global model parameters. The main training script looks like the following.
obs += info["size"]
# apply update, get the weights from the model, start a new task on the same actor object
policy.model_update(gradient)
policy.apply_gradients(gradient)
parameters = policy.get_weights()
gradient_list.extend([agents[info["id"]].compute_gradient(parameters)])
return policy