๐Ÿš€ LunarLander-v3 Dueling Double DQN Model

This repository contains a trained Dueling Double Deep Q-Network (Dueling Double DQN) PyTorch model for OpenAI Gymnasium's LunarLander-v3 environment.

๐Ÿ“Š Model Performance & Specifications

  • Algorithm: Dueling Double Deep Q-Network (PyTorch)
  • Environment: LunarLander-v3
  • Exploration Schedule (Epsilon): $1.0 ightarrow 0.05$ (100% to 5%)
  • Target Performance: Smooth, graceful touchdown with high average score ($\ge 200\sim 250+$)

๐Ÿ“ Repository Contents

  • checkpoint_best.pth: PyTorch trained model weights (Best checkpoint)
  • model.py: PyTorch DuelingQNetwork architecture
  • agent.py: DQN Agent and ReplayBuffer implementation

๐ŸŽฎ How to Load & Test in Python

import torch
import gymnasium as gym
from model import DuelingQNetwork

# 1. Initialize LunarLander environment
env = gym.make("LunarLander-v3", render_mode="human")
state, _ = env.reset(seed=42)

# 2. Instantiate Network & Load Weights
model = DuelingQNetwork(state_size=8, action_size=4)
model.load_state_dict(torch.load("checkpoint_best.pth", map_location="cpu"))
model.eval()

# 3. Run Evaluation Episode
done = False
total_reward = 0
while not done:
    state_tensor = torch.from_numpy(state).float().unsqueeze(0)
    with torch.no_grad():
        q_values = model(state_tensor)
    action = q_values.argmax(dim=-1).item()
    
    state, reward, terminated, truncated, _ = env.step(action)
    done = terminated or truncated
    total_reward += reward

print(f"Touchdown Episode Completed! Total Reward: {total_reward:.2f}")
env.close()
Downloads last month

-

Downloads are not tracked for this model. How to track
Video Preview
loading