CoolFace
Modelpublic

chrisluo5311/a2c-PandaReachDense-v3

sourceHugging Faceupdated 3d agoView on Hugging Face
0likes29downloads
Model Card

A2C Agent playing PandaReachDense-v3

This is a trained model of a A2C agent playing PandaReachDense-v3 using the stable-baselines3 library.

Environment

  • —Task: move the end-effector of a Franka Emika Panda robotic arm to a randomly sampled target position (the green ball).
  • —Observation: a Dict with three entries, which is why MultiInputPolicy is used instead of MlpPolicy:
  • —observation: end-effector position (x, y, z) and velocity (vx, vy, vz)
  • —achieved_goal: current end-effector position (x, y, z)
  • —desired_goal: target position (x, y, z)
  • —Action: 3-dim continuous end-effector displacement (x, y, z). Joints are not controlled directly.
  • —Reward (dense): negative Euclidean distance between the end-effector and the target at every step, so values closer to 0 are better.

Results

MetricValue
Mean reward-0.21
Std reward0.08

Evaluated for 10 episodes with a deterministic policy, using the saved VecNormalize statistics (frozen, with reward normalization disabled).

Usage (with Stable-baselines3)

python
import gymnasium as gym
import panda_gym
from huggingface_sb3 import load_from_hub
from stable_baselines3 import A2C
from stable_baselines3.common.vec_env import DummyVecEnv, VecNormalize

repo_id = "chrisluo5311/a2c-PandaReachDense-v3"
model_path = load_from_hub(repo_id, "a2c-PandaReachDense-v3.zip")
stats_path = load_from_hub(repo_id, "vec_normalize.pkl")

env = DummyVecEnv([lambda: gym.make("PandaReachDense-v3", render_mode="rgb_array")])
env = VecNormalize.load(stats_path, env)
env.training = False      # do not update normalization stats at test time
env.norm_reward = False

model = A2C.load(model_path, env=env)

obs = env.reset()
for _ in range(1000):
    action, _ = model.predict(obs, deterministic=True)
    obs, rewards, dones, infos = env.step(action)

Hyperparameters

ParameterValue
PolicyMultiInputPolicy
Total timesteps1,000,000
Parallel environments4 (DummyVecEnv)
VecNormalizenorm_obs=True, norm_reward=True, clip_obs=10.0
OthersStable-Baselines3 A2C defaults (learning_rate=7e-4, n_steps=5, gamma=0.99, gae_lambda=1.0, ent_coef=0.0, vf_coef=0.5, max_grad_norm=0.5, RMSprop optimizer)