FragileTech / FractalAI

Cellular automaton-based calculus for the masses
https://github.com/FragileTech
GNU Affero General Public License v3.0
68 stars 14 forks source link

What is the meaning of the variable "state" in your code? #91

Closed zhan0903 closed 4 years ago

zhan0903 commented 6 years ago

I think the variable "obs" is the observation of the gym environment, but what is the variable "state", I can't understand it. Thanks.

sergio-hcsoft commented 6 years ago

In Atari games -and in the code- you can use (a) the screen image or (b) a dump of the RAM as an observation, while the "state" is basically the RAM content (plus some additional info like the action being applied, the actual score or the number of remaining lives in some cases) so you can copy-paste it from one instance of the Atari simulator to another, and the game will continue running unnoticed in the second one.

For instance, you can check it in swarm.py class DataStorage: "This is a class for storing the states and the observations of a Swarm."

zhan0903 commented 6 years ago

I checked the code and found the "obs" size is 128 which is the same as the gym document says, but the "state" size is 1013, so what is the difference between them? If "state" contains everything need, why need the variable "obs"? Thanks.

sergio-hcsoft commented 6 years ago

State contains all info about the game state: ram, screen and a dictionary with the other info of the simulator. Obs only contains ram or screen but not both.