Farama-Foundation / Minigrid

Simple and easily configurable grid world environments for reinforcement learning
https://minigrid.farama.org/
Other
2.13k stars 611 forks source link

Train test split #159

Closed nishantb21 closed 3 years ago

nishantb21 commented 3 years ago

Added the split functionality to the colors array of EmptyEnv in negated_goals. The colors get conceptually split into train and evaluation sets by limiting the indices. The usage is akin to PyTorch style set_train() and set_eval() modes. Training mode restricts the indices to [0, len(colors) split) and evaluation mode restricts the indices to [len(colors) split, len(colors)). It is extensible to types of objects too as the split function simply takes the length of an array as the argument.