mirror of
https://github.com/ltcptgeneral/cse151b-final-project.git
synced 2024-12-26 10:09:10 +00:00
this should probably be working but isn't
This commit is contained in:
parent
320f2f81b7
commit
83e81722d2
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
**/data/*
|
**/data/*
|
||||||
|
**/*.zip
|
24
dqn_wordle.py
Normal file
24
dqn_wordle.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user