<jupyter_start><jupyter_text><jupyter_code>!git clone https://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@github.com/kiritowu/Great-Lunar-Lander.git
%cd Great-Lunar-Lander
!apt-get install -y xvfb x11-utils
!pip install pyvirtualdisplay==0.2.* PyOpenGL==3.1.* PyOpenGL-accelerate==3.1.*

!pip install Box2D
!pip install box2d
!pip install box2d-py 
!pip install gym[all]
import base64
import io
from IPython import display
from pyvirtualdisplay import Display

d = Display(visible=False,  # use False with Xvfb
                                    size=(1400, 900))
d.start()
import gym
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf


from gym.wrappers import Monitor
from utils import seed_everything, Experience, ReplayBuffer
seed_everything(1)
from model.ddpg import DDPG
!echo $DISPLAY # should now be set to some value
# Allow Continuous Action Space for Lunar-Lander
env = Monitor(gym.make('LunarLanderContinuous-v2'), "./", force=True)
o = env.reset()
# set seeds
env.seed(1)

# setting up params
lr = 0.001
tau = 0.005
gamma = 0.99
training_episodes = 1000

# create new deep q-network instance
model = DDPG(env, lr, tau, gamma)
model.train(training_episodes, True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09587955625990491, 'fraction_numerical': 0.03328050713153724, 'mean_word_length': 4.613333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '411142', 'license': 'MIT', 'n_tokens_mistral': 483, 'n_tokens_neox': 449, 'n_words': 129, 'path': 'RL/Great-Lunar-Lander-with-DQN/notebook-archieve/experiments/test_record_video.ipynb', 'repo_name': 'kiritowu/Deep-Learning', 'size': '1262'}