LunarLander-v3 Dueling Double-DQN Agent
This is a trained Dueling Double-DQN agent capable of performing perfect, smooth, and robust landings in the Gymnasium LunarLander-v3 environment with an evaluation score of 289.2.
Algorithm & Training Details
- Algorithm: Dueling Double-DQN (D3QN)
- Framework: PyTorch + Gymnasium
- State Space: 8 dimensions (Position, Velocity, Angle, Angular Velocity, Leg contacts)
- Action Space: Discrete(4) - [0: Do Nothing, 1: Fire Left RCS, 2: Fire Main Engine, 3: Fire Right RCS]
- Exploration (Epsilon): $1.0 (100%) \rightarrow 0.05 (5%)$
- Loss Function: Smooth L1 (Huber Loss)
- Target Network Update: Soft Polyak Update ($\tau = 0.005$)
- Peak Score: +289.2
How to Run Inference
import torch
import gymnasium as gym
from dqn_agent import DQNAgent
# 1. Initialize environment
env = gym.make("LunarLander-v3", render_mode="human")
state, _ = env.reset()
# 2. Load Agent
agent = DQNAgent(state_dim=8, action_dim=4)
agent.load("best_lunar_lander_dqn.pth")
# 3. Simulate
total_reward = 0
done = False
while not done:
action, _ = agent.select_action(state, evaluate=True)
next_state, reward, terminated, truncated, _ = env.step(action)
done = terminated or truncated
state = next_state
total_reward += reward
print(f"Final Landing Reward: {total_reward:.2f}")
env.close()
Evaluation results
- Mean Reward on LunarLander-v3self-reported289.200