Downloads · 30 days
1
2% of all-time downloads
DahuTimide/a2c-CartPole-v1
a2c-CartPole-v1 is a reinforcement learning model from DahuTimide. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. It is set up for stable-baselines3.
This is a trained model of a A2C agent playing CartPole-v1 using the stable-baselines3 library.
Downloads · 30 days
1
2% of all-time downloads
All-time downloads
45
Public
Repo size
188 KB
Likes
0
Public
Click a slice to open those files.
.zip102 KB · 46%
From the Hugging Face model README
This is a trained model of a A2C agent playing CartPole-v1 using the stable-baselines3 library.
TODO: Add your code
from stable_baselines3 import AC2
from huggingface_sb3 import load_from_hub
import gymnasium as gym
checkpoint = load_from_hub(
repo_id="DahuTimide/a2c-CartPole-v1",
filename="A2C_mso_3_4.zip",
)
model = A2C.load(checkpoint)
env = gym.make("CartPole-v1", render_mode="human")
obs, _info = env.reset()
for _ in range(1000):
action, _states = model.predict(obs, deterministic=True)
obs, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
obs, _info = env.reset()
env.close()