Downloads · 30 days
0
Bapttheo/BE_RL_CartPole
BE_RL_CartPole is a machine learning model from Bapttheo. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Mar 5, 2024
Repo size
204 KB
Likes
0
Public
Click a slice to open those files.
.zip204 KB · 99%
From the Hugging Face model README
Run the model with the code below :
import gym
from stable_baselines3 import A2C
# Load
model = A2C.load("BE_RL_CartPole/a2c_cartpole")
env_human = gym.make("CartPole-v1",render_mode="human")
obs = env_human.reset()[0]
for i in range(1000):
action, _states = model.predict(obs, deterministic=True)
obs, rewards, dones, info, _ = env_human.step(action)
env_human.render()
# Close
env_human.close()