Downloads · 30 days
0
0% of all-time downloads
fshamass/a2c-PandaReachDense-v3
a2c-PandaReachDense-v3 is a reinforcement learning model from fshamass. 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 PandaReachDense-v3 using the stable-baselines3 library.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
12
Public
Repo size
1 MB
Likes
0
Public
Click a slice to open those files.
.mp4587 KB · 70%
From the Hugging Face model README
This is a trained model of a A2C agent playing PandaReachDense-v3 using the stable-baselines3 library.
from stable_baselines3 import A2C
from stable_baselines3.common.env_util import make_vec_env
from stable_baselines3.common.evaluation import evaluate_policy
import gymnasium as gym
import panda_gym
# Create the environment (make sure to use the same env as during training)
env = gym.make("PandaReachDense-v3", render_mode="rgb_array")
from stable_baselines3.common.vec_env import DummyVecEnv, VecNormalize
env = DummyVecEnv([lambda: gym.make("PandaReachDense-v3", render_mode="rgb_array")])
env = VecNormalize.load("vec_normalize.pkl", env)
env.training = False
env.norm_reward = False
# Load the trained agent
model = A2C.load("a2c-PandaReachDense-v3")
# Evaluate the agent
mean_reward, std_reward = evaluate_policy(model, env, n_eval_episodes=10)
print(f"Mean reward = {mean_reward:.2f} +/- {std_reward:.2f}")