Downloads · 30 days
0
0% of all-time downloads
mioti-mic/gym_xarm_4tasks
gym_xarm_4tasks is a reinforcement learning model from mioti-mic. 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. The card lists the license as mit.
This repository contains a Stable-Baselines3 SAC model trained on gymxarm/XarmLift-v0, conditioned to perform 4 directional pushing tasks with a single policy.
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
19
Public
Repo size
34.2 MB
Likes
0
Public
Click a slice to open those files.
.mp421.7 MB · 63%
From the Hugging Face model README
This repository contains a Stable-Baselines3 SAC model trained on
gym_xarm/XarmLift-v0, conditioned to perform 4 directional pushing tasks
with a single policy.
The policy receives the desired task as part of the observation (goal-conditioning).
The model supports 4 pushing directions, encoded as a one-hot vector:
| Goal ID | Name | Direction (world frame) |
|---|---|---|
| 0 | forward | +X |
| 1 | left | +Y |
| 2 | right | −Y |
| 3 | back | −X (towards robot base) |
The goal is appended to the observation as a 4D one-hot vector.
obs = [env_obs(28), goal_one_hot(4)]
Continuous action space:
Box(4,) in range [-1, 1]
(As defined by gym_xarm/XarmLift-v0)
best_model.zip — Trained SAC policy (Stable-Baselines3)vecnormalize.pkl — Observation normalization statistics (VecNormalize)⚠️ Important: vecnormalize.pkl must be loaded for correct inference.
import gymnasium as gym
import gym_xarm
import numpy as np
from stable_baselines3 import SAC
from stable_baselines3.common.vec_env import DummyVecEnv, VecNormalize
# Create env (must match training wrappers!)
def make_env():
env = gym.make("gym_xarm/XarmLift-v0")
# add the same goal-conditioning wrapper used during training
# (28 -> 32 obs)
return env
venv = DummyVecEnv([make_env])
# Load VecNormalize stats
venv = VecNormalize.load("vecnormalize.pkl", venv)
venv.training = False
venv.norm_reward = False
# Load model
model = SAC.load("best_model.zip")
# Example inference loop
obs = venv.reset()
for _ in range(300):
action, _ = model.predict(obs, deterministic=True)
obs, reward, done, info = venv.step(action)