Open In Colab

DQN Algorithm Solving Lunar Lander

Import modules

Set up Q network

Create a DQN agent

Function to run above classes

Run the DQN for CartPole

This serves as a toy problem for the algorithm to check it is functioning properly.

Plot the graphs

Run the code for Lunar Lander

Plot the rewards per episode

Plot the losses/time_step for each episode

Plot all the graphs

Run the display to get the output video

Code often crashes the notebook so it has been commented out.