Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data augmentation for Sokoban #222

Open
carlosgmartin opened this issue Feb 7, 2024 · 0 comments
Open

Add data augmentation for Sokoban #222

carlosgmartin opened this issue Feb 7, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@carlosgmartin
Copy link

carlosgmartin commented Feb 7, 2024

Add an option to apply data augmentation when sampling 10 × 10 Sokoban levels from the DeepMind Boxoban dataset.

More precisely, at reset, apply one of the 8 symmetries of the square uniformly at random to the loaded level. Here's an example implementation:

bits = random.bernoulli(key, shape=[3])
level = jnp.where(bits[0], level, level[::-1, :])  # vertical flip
level = jnp.where(bits[1], level, level[:, ::-1])  # horizontal flip
level = jnp.where(bits[2], level, jnp.rot90(level))  # 90-degree rotation
@carlosgmartin carlosgmartin added the enhancement New feature or request label Feb 7, 2024
@sash-a sash-a added the help wanted Extra attention is needed label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants