Edouard Silvestre
Back to projects

Epitech · 2nd year · Pair project

StarTrek

A DQN agent that learns to land a lunar module.

  • Python
  • PyTorch
  • Gymnasium
  • DQN
Try it
Period
April 2026
Team
Pair project
Code
Private repository
Q(s, a)noopleftmainrightLunarLander · Gymnasiumfig. 08 — StarTrek · a DQN learns to land

The project

Reinforcement learning with a DQN, on Gymnasium’s LunarLander environment.

The heart of the work: designing the reward function and tuning the hyperparameters to stabilise the model.

What was hard

  • A DQN is unstable: without a target network, the agent learns fast, then collapses and turns chaotic.
  • Finding the right balance between exploration and exploitation, and reading a reward shaped by the environment.

What I learned

  • Proving that a component is useful with an ablation study: remove it and measure what happens.
  • Why a replay buffer and a target network stabilise learning.
  • Analysing how episodes end, crash, landing or timeout, to understand what the agent has learned.

Try it.

The agent at the controls

Trained model

  • Three landings

    Three episodes played by the trained DQN, with no intervention.