glmcdona / LuxPythonEnvGym

Matching python environment code for Lux AI 2021 Kaggle competition, and a gym interface for RL models.
MIT License
73 stars 38 forks source link

fix maps and add test to check maps are correct against the 100 seeds #70

Closed StoneT2000 closed 2 years ago

StoneT2000 commented 2 years ago

there appears to probably be a bug with RNG, not your map implementation, but this test is working now it seems.

StoneT2000 commented 2 years ago

Run python -m unittest luxai2021.tests.test_map.TestMap.test_map_gen_valid to test. It generated two maps correctly at the moment, seed 10002 it doesn't

royerk commented 2 years ago

That must be why my training is great but my public score is below 0 ;)

StoneT2000 commented 2 years ago

looks like the config has a default map size of 32 and it seems to be fixed to that? @glmcdona everything else seems good though.

glmcdona commented 2 years ago

Awesome, thanks @StoneT2000!

@royerk, also have a look at this line used in inference: https://github.com/glmcdona/LuxPythonEnvGym/blob/df464cc38b22aed393e449b2426fff4217e2d442/examples/agent_policy.py#L530

Try modifying both this line and the similar line below for cities to be deterministic=False to see if you get more closer to your expected result in inference mode. In inference mode, it doesn't randomly perturbate the actions since it doesn't need to explore. Some solutions converge to weird solutions that will just repeatedly do an invalid action, relying on this randomness to explore. I don't think this map change is likely to change the result of your model significantly.

royerk commented 2 years ago

@glmcdona shouldn't it be merged then?

glmcdona commented 2 years ago

My bad, merged!