open_spiel icon indicating copy to clipboard operation
open_spiel copied to clipboard

Question about the PSRO.

Open wyz2368 opened this issue 6 years ago • 8 comments

Dear authors,

I am trying to find some examples of applying DRL as an oracle to the generalized PSRO framework. However, I found that in examples related to PSRO (e.g generalized PSRO and RNR) only an evolutionary-strategy oracle is being used for simplification. So I am wondering if there is an example in which PSRO is combined with DRL as experiments in the corresponding papers. Moreover, I notice that there are implemented actor-critic and DQN in the library. Is there a simple way to combine them with PSRO? Thank you.

wyz2368 avatar Feb 03 '20 17:02 wyz2368

Hi @wyz2368 ,

We unfortunately do not have the full PSRO as described in the paper with Deep RL oracles.

It is very much something we would like to have in the code base, though. And yes, there should be a simple way to combine them with PSRO, but we have not had the time to do it.

It would be a very welcome contribution that I could help advise (maybe with help from the original author), if you're interested. It would involve making a custom RL environment that would in the fixed policies of the other players that DQN could train on.

lanctot avatar Feb 05 '20 02:02 lanctot

Hi @lanctot,

Thank you for your reply. In fact, I am currently writing the code and trying to make the policy gradient algorithms (the version in OpenSpiel) an oracle for PSRO. I don't know how general the code is going to be because the DRL codes (DQN, A2C, etc.) in OpenSpiel are customed to a multi-agent setting. What I am doing is that suppose PSRO starts with a uniform strategy for each player. In each iteration, I keep the DRL agent in a training model for the current player who is training while fixing other players' agents by setting the flag is_evalution to be True in agent.step(time_step, is_evaluation=True). Obviously, my code is highly specific to the RL code in OpenSpiel.

Moreover, I found that the Nash solver in OpenSpiel now can only solve two-player zero-sum games. Another thing I am doing is to add a more general Nash solver to OpenSpiel, which can be used in the double-oracle algorithm or others that need Nash equilibrium.

wyz2368 avatar Feb 05 '20 03:02 wyz2368

That sounds great, and it's exactly what I had in mind. I'm not worried if the PSRO implementation here would be highly specific to the RL code in OpenSpiel; it's in OpenSpiel for that reason, provided as an example. If people want to generalize it to other RL algorithms or frameworks, they are welcome to.

BTW, there is an example of solving a (2-player) general-sum matrix game here (using nashpy): https://github.com/deepmind/open_spiel/blob/master/open_spiel/python/examples/matrix_nash.py but it seems like we never put that into a general library. I agree, it would be good to have that as a general function that can just be called.

Would be great to submit a PR with these additions when you think it's ready!

lanctot avatar Feb 06 '20 04:02 lanctot

Hi @wyz2368 , as we have been discussing over email, we are also working on DeepRL oracles for PSRO internally (and by 'we', I mean almost entirely @paulfmmuller!!) Just updating the thread here to let others know that we plan to release the code, but might take several weeks for review since it's a large change.

lanctot avatar Feb 18 '20 18:02 lanctot

Quick follow-up, thanks to the work of @PaulFMMuller, Monday's update will include all of his implementations. Quoting an email from him:

"It will introduce a number of breaking changes ; we have for the moment identified the following ones : - Oracles now take in a list of list of dictionaries specifying training parameters, and therefore, all former oracles are now deprecated (But new ones have been added) - EvolutionaryOracle has been removed. - (minor) file name changes, helper functions moved to new files, function name changes

In counterpart, it will introduce: - New oracles (Exact Best Response, RL Oracle supporting Policy Gradient and DQN) - Self-Play training - Symmetric game optimizations - A Policy Aggregator working with Joint Probabilities - An actual example running on Kuhn, Leduc, ..., and computing exploitabilities - Misc. refactorizations and code improvements."

In addition, he has reproduced the original results from Lanctot et al. 2017 on Leduc (even improved it down to NashConv of 0.46!

lanctot avatar Feb 26 '20 22:02 lanctot

Hi there ! The internal reviews have taken longer than anticipated, and unfortunately, the whole of the update hasn't made it to this Monday's code update ; only small parts have been included. Nevertheless, things are drawing to a close, and we're anticipating the update to soon be submitted, apologies if you were hoping to start working on it today :/

PaulFMMuller avatar Mar 02 '20 10:03 PaulFMMuller

I believe all of Paul's implementations are in the code base now, so closing this. Please re-open if you want to discuss further! Thanks again, Paul!

lanctot avatar Mar 08 '20 16:03 lanctot

Thanks! @lanctot @PaulFMMuller :)))

wyz2368 avatar Mar 08 '20 16:03 wyz2368