p-christ / Deep-Reinforcement-Learning-Algorithms-with-PyTorch

PyTorch implementations of deep reinforcement learning algorithms and environments
MIT License
5.59k stars 1.19k forks source link

Add A2C algorithm #1

Open p-christ opened 5 years ago

p-christ commented 5 years ago

Add the A2C algorithm which is the synchronous version of the algorithm described in this paper https://arxiv.org/pdf/1602.01783.pdf and described here: https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part-8-asynchronous-actor-critic-agents-a3c-c88f72a5e9f2

josiahls commented 5 years ago

Is this still being worked on? I am getting this error below from running the cartpole test.

As you can see, the hyperparameters dict has 2 parent keys: Actor, Critic. The linear_hidden_units key is embedded in each of those, thus getting a key error. Do you have working code for this? It seems that the nn_builder needs to do some complex neural net building for handling the actor and critic. I feel that instead maybe it would be better to keep them as separate neural nets?

image

p-christ commented 5 years ago

hi, yep this is still being worked on, thanks for pointing out this error.

I've updated it now and it works again for me (although it is a bit more messy now), does it work for you? I have them as one network because it means they get to share the knowledge gathered in the lower layers of the network and so it can be more efficient