this should probably be working but isn't

This commit is contained in:
ltcptgeneral 2024-03-12 22:14:03 -07:00
parent 320f2f81b7
commit 83e81722d2
2 changed files with 26 additions and 1 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
**/data/* **/data/*
**/*.zip

24
dqn_wordle.py Normal file
View File

@ -0,0 +1,24 @@
import gym
import gym_wordle
from stable_baselines3 import DQN
env = gym.make("Wordle-v0")
done = False
print(env)
model = DQN("MlpPolicy", env, verbose=1)
model.learn(total_timesteps=10000, log_interval=100)
model.save("dqn_wordle")
del model # remove to demonstrate saving and loading
model = DQN.load("dqn_wordle")
state = env.reset()
while not done:
action, _states = model.predict(state, deterministic=True)
state, reward, done, info = env.step(action)