dopamine icon indicating copy to clipboard operation
dopamine copied to clipboard

Can i use my own game environnement ?

Open florian02100 opened this issue 6 years ago • 11 comments

Hi,

I want to use Dopamine with my own game environnement. I don't use asterix, pong ou atari environnement.

Dopamine allows to do stuff like that ?

Thanks

florian02100 avatar Dec 21 '18 11:12 florian02100

Yes, although at the moment you will need to modify some Atari-specific parameters (convolutional network, observation shape, etc.) I believe most of that code is in place – but stay tuned for an update that will make all of this easier.

mgbellemare avatar Dec 21 '18 18:12 mgbellemare

Hi Marc,

Thank you for the answer!

So I think that I need to clone atari folder (https://github.com/google/dopamine/tree/master/dopamine/atari) and I change Atari-specific parameters in preprocessing, run_experiment.py and in train.py , it's correct?

Merry Christmas !

florian02100 avatar Dec 23 '18 09:12 florian02100

Yes, that's right. Look around the open/closed issues here, I believe other people have generate similar code. Good luck!

mgbellemare avatar Dec 23 '18 14:12 mgbellemare

I believe that my team has just succeed doing that. You can check out our git https://github.com/KatyNTsachi/Hierarchical-RL the gym game is in folder the folder "gym_cars"

Hope this will help

tsachiblau avatar Jan 08 '19 21:01 tsachiblau

Hi tsachiblau,

Thank you ! it's a good job ! I'll try to create my own env from your code.

Thank you.

florian02100 avatar Jan 13 '19 17:01 florian02100

@tsachiblau Can you please describe what all changes you made to create your own environment. Also, can we extend the "game-like" environment to something very simple. For example, below is the environment I want to replicate.

Board Environment:
|O|O|*|O|O|
|O|O|O|O|O|
|O|O|O|O|O|
|O|#|O|$|O|
|$|O|O|O|O|

State space: (x,y) where 0 <= x <= 4, 0 <= y <= 4

Action space: {0,1,2,3} where 0 == Left, 1 == Right, 2 == Down, 3 == Up

Reward: -1 for taking one step, -INF for out of bound, -INF for landing at #, 6 for $, 0 for O

Transition function: 0:(x,y) -> (x-1,y), 1:(x,y) -> (x+1,y), 2:(x,y) -> (x, y-1), 3:(x,y) -> (x,y+1)

Starting state: (0, 2) Terminal state: (3, 3)

vishal-keshav avatar Jan 22 '19 09:01 vishal-keshav

@vishal-keshav first of all you can check out our git https://github.com/KatyNTsachi/Hierarchical-RL right now it's basically the original dopamine with our env in it.

If you want to see all the changes that we did you can compare our code to the original dopamin code in this link: https://github.com/KatyNTsachi/Hierarchical-RL/commit/40e995d9ab8cdab396415ea77c9041a53e3acbb5

You also need to follow this guide for creating you own env https://stackoverflow.com/questions/45068568/is-it-possible-to-create-a-new-gym-environment-in-openai

tsachiblau avatar Jan 22 '19 12:01 tsachiblau

@tsachiblau or any others who might know,

I just want to clarify, that we can use dopamine with our own non-openai environments, as long as we can connect the observations? In my case, I am trying to use the Deepmind Lab environment.

ryanprinster avatar Jan 23 '19 23:01 ryanprinster

I think that point of dopamine is to make kind of benchmark for RL so adding your own env even possible, maybe meaningless.

yakotaki avatar Jan 24 '19 05:01 yakotaki

Regardless, the question still stands with an unclear answer

ryanprinster avatar Jan 24 '19 08:01 ryanprinster

@ryanprinster you can create your our env and then wrap it with this guide: https://stackoverflow.com/questions/45068568/is-it-possible-to-create-a-new-gym-environment-in-openai

then you will have gym env(with your own game)

tsachiblau avatar Jan 24 '19 09:01 tsachiblau