Skip to main content

A Sudoku environment for Reinforcement Learning research

Project description

[!warning] Under active development...Expect frequent code changes....

pip install gymnasium_sudoku
import gymnasium_sudoku
import gymnasium as gym

env = gym.make("sudoku-v0",render_mode="human",horizon=150,eval_mode=True)
env.reset(delay=0.1) # delay param control the update rate of the gui
steps = 100

for n in range(steps):
    env.step(env.action_space.sample())
    env.render() 

And for training :

env = gym.make("sudoku-v0",horizon=150,eval_mode=False)
# It is better not to call .render() during training 

By default, eval_mode is set to False, this is good for training since after each reset() call,the Sudoku board will be changed to add more diversity to the training data and try to prevent memorization, so that the policy learns a more general distribution...At least that is the intuition.

During testing, eval_mode should be set to True to test the generalization capabilities of a trained policy or to test the environment with a random policy.This is important; otherwise,when testing a trained policy,it will be tested on states seen during training which would measure memorization rather than generalization.This makes it an invalid test of the policy's true capabilities.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gymnasium_sudoku-0.2.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gymnasium_sudoku-0.2.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file gymnasium_sudoku-0.2.1.tar.gz.

File metadata

  • Download URL: gymnasium_sudoku-0.2.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gymnasium_sudoku-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2d6f3c7882c2c2f5168be3a582dde1dc9965e48287e22b70126e153e17d1d38a
MD5 abbdbb6b9503baf5725f30b040f87ded
BLAKE2b-256 f106b2a01b7a1e2b34e95fcc5e4cf7ac350c5af2dd055e251b23b17c81158a85

See more details on using hashes here.

File details

Details for the file gymnasium_sudoku-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gymnasium_sudoku-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9a18c184351e100878e54b87d67fe762adb6b47bfa5037cb6971c3ea571f647
MD5 47e75739d9526c7974ae26014a5aee54
BLAKE2b-256 e6a9be0f74ff9f97d4bc413003b42254f3a3b1c852bde83785b021cabbb858d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page