Downloads · 30 days
0
Mostafa134/sac-LunarLander-v3
sac-LunarLander-v3 is a reinforcement learning model from Mostafa134. 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 custom-rl.
This is a custom SAC (Soft Actor-Critic) model trained on LunarLander-v3.
Downloads · 30 days
0
Access
Public
Updated Dec 9, 2025
Repo size
1.4 MB
Likes
0
Public
Click a slice to open those files.
.pth1.4 MB · 100%
From the Hugging Face model README
This is a custom SAC (Soft Actor-Critic) model trained on LunarLander-v3.
import torch
import gymnasium as gym
from SAC import SACAgent
# Load the model
env = gym.make("LunarLander-v3", continuous=True)
state_dim = env.observation_space.shape[0]
action_dim = env.action_space.shape[0]
config = {'learning_rate': 0.0003, 'gamma': 0.99, 'tau': 0.005, 'alpha': 0.2, 'batch_size': 256, 'buffer_size': 100000}
agent = SACAgent(state_dim, action_dim, env.action_space, config)
checkpoint = torch.load("model.pth", map_location="cpu")
agent.policy.load_state_dict(checkpoint['policy'])
if 'critic' in checkpoint:
agent.critic.load_state_dict(checkpoint['critic'])
if 'critic_target' in checkpoint:
agent.critic_target.load_state_dict(checkpoint['critic_target'])