switch to notebook

This commit is contained in:
Arthur Lu 2024-03-13 11:04:30 -07:00
parent 83e81722d2
commit e9622b6f68
2 changed files with 4743 additions and 24 deletions

4743
dqn_wordle.ipynb Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +0,0 @@
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)