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

feat(sudoku): implement environment #125

Merged
merged 61 commits into from
Jun 1, 2023

Conversation

Egiob
Copy link
Contributor

@Egiob Egiob commented Apr 28, 2023

This PR contains all the changes related to the addition of the Sudoku environment. See below the principal stuff that needs to be discussed before merging (in my opinion).

Generator

Currently the environment uses a default DatabaseGenerator that resets to a new puzzle included in a pre-loaded database. These data are included under jumanji.environments.logic.sudoku.data. For now two databases are included: 1000_very_easy_puzzles.npy containing 1000 puzzles with >= 46 clues and 10000_ mixed_puzzles.npy containing 10000 puzzle of various difficulties. The exact number of puzzles may be changed so that (1) the "very-easy" dataset is indeed very-easy for A2C and (2) the "mixed" dataset contains enough diversity while not taking too much memory in the repo.

Versions

Two envs have been registered: Sudoku-v0 using by default the 10000_mixed_puzzles.npy database and Sudoku-very-easy-v0 using by default the 1000_very_easy_puzzles.npy database. For simplicity purpose, we propose to train the A2C agent on this latter environment.

Remaining actions:

  • Check that the training on the very-easy dataset meets expectations
  • Update Sudoku GIF and Image accordingly
  • Revert changes in notebooks

References:
This is the paper I used to define that >=46 clues was "very-easy".

@Egiob Egiob added the enhancement New feature or request label Apr 28, 2023
@Egiob Egiob requested a review from clement-bonnet April 28, 2023 12:38
@Egiob Egiob self-assigned this Apr 28, 2023
@CLAassistant
Copy link

CLAassistant commented Apr 28, 2023

CLA assistant check
All committers have signed the CLA.

@clement-bonnet clement-bonnet changed the title feat(sudoku): add environment feat(sudoku): implement environment Apr 28, 2023
Copy link
Collaborator

@clement-bonnet clement-bonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. Overall, looks very good to me. I have a few comments and NIT suggestions.
We can merge once we have a training curve (working), I'm wondering if we can make the network equivariant to permutation of digits at least.
Please let me know if you have any questions.

README.md Outdated Show resolved Hide resolved
docs/env_anim/sudoku.gif Outdated Show resolved Hide resolved
docs/environments/sudoku.md Show resolved Hide resolved
docs/environments/sudoku.md Show resolved Hide resolved
jumanji/environments/logic/sudoku/env.py Outdated Show resolved Hide resolved
jumanji/environments/logic/sudoku/reward.py Outdated Show resolved Hide resolved
jumanji/environments/logic/sudoku/viewer.py Outdated Show resolved Hide resolved
jumanji/training/setup_train.py Outdated Show resolved Hide resolved
jumanji/training/setup_train.py Outdated Show resolved Hide resolved
Egiob and others added 2 commits May 5, 2023 15:31
Co-authored-by: Clément Bonnet <56230714+clement-bonnet@users.noreply.github.com>
Egiob and others added 5 commits May 31, 2023 10:38
Co-authored-by: Tristan Kalloniatis <tristankalloniatis@gmail.com>
Co-authored-by: Clément Bonnet <56230714+clement-bonnet@users.noreply.github.com>
clement-bonnet
clement-bonnet previously approved these changes Jun 1, 2023
Copy link
Collaborator

@clement-bonnet clement-bonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the very nice contribution. I left a couple of nit comments. All good to me otherwise.

jumanji/environments/logic/sudoku/env.py Outdated Show resolved Hide resolved
jumanji/environments/logic/sudoku/env.py Outdated Show resolved Hide resolved
jumanji/training/networks/sudoku/actor_critic.py Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
Egiob and others added 2 commits June 1, 2023 12:18
Co-authored-by: Daniel <57721552+dluo96@users.noreply.github.com>
clement-bonnet
clement-bonnet previously approved these changes Jun 1, 2023
Egiob and others added 4 commits June 1, 2023 13:42
Co-authored-by: Tristan Kalloniatis <tristankalloniatis@gmail.com>
@Egiob Egiob merged commit be71610 into instadeepai:main Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants