Downloads · 30 days
5
7% of all-time downloads
giansimone/PPO-MuJoCo-HalfCheetah-v5
PPO-MuJoCo-HalfCheetah-v5 is a reinforcement learning model from giansimone. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product.
This is a trained Proximal Policy Optimization (PPO) agent for the MuJoCo HalfCheetah-v5 environment.
Downloads · 30 days
5
7% of all-time downloads
All-time downloads
69
Public
Repo size
2.1 MB
Likes
0
Public
Click a slice to open those files.
.mp41.8 MB · 86%
From the Hugging Face model README
This is a trained Proximal Policy Optimization (PPO) agent for the MuJoCo HalfCheetah-v5 environment.
The model was trained using the code available here.
To load and use this model for inference:
import torch
import json
import gymnasium as gym
from agent import SimpleAgent
from environment import make_env
#Load the configuration
with open("config.json", "r") as f:
config = json.load(f)
env_id = config["env_id"]
hidden_dim = config["hidden_dim"]
# Create environment. Get action and space dimensions
env, state_size, action_size = make_env(
env_id,
render_mode="human",
)
# Instantiate the agent and load the trained policy network
agent = SimpleAgent(state_size, action_size, hidden_dim)
agent.policy.load_state_dict(torch.load("model.pt"))
# Enjoy the agent!
state, _ = env.reset()
done = False
while not done:
action = agent.select_action(state, deterministic=True)
state, reward, terminated, truncated, _ = env.step(action)
done = terminated or truncated
env.render()
env.close()