<jupyter_start><jupyter_text>Training an Advantage Actor Critic Model on the Lunar Lander Environment  Importing Model and Libraries<jupyter_code># !git clone https://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@github.com/kiritowu/Great-Lunar-Lander.git
# %cd Great-Lunar-Lander
# %%capture
# !pip install Box2D
# !pip install box2d
# !pip install box2d-py
# !pip install wandb
import gym
import wandb
from utils import seed_everything
from model.a2c import A2C
wandb.login()<jupyter_output>Failed to detect the name of this notebook, you can set it manually with the WANDB_NOTEBOOK_NAME environment variable to enable code saving.
[34m[1mwandb[0m: You can find your API key in your browser here: https://wandb.ai/authorize
[34m[1mwandb[0m: Appending key for api.wandb.ai to your netrc file: /home/tiencheng/.netrc<jupyter_text>Initiate Tracking with Weights and Biases<jupyter_code>wandb.init(
    entity="onsen",
    project="a2c-lunar-lander"
)<jupyter_output>[34m[1mwandb[0m: W&B API key is configured (use `wandb login --relogin` to force relogin)
2022-01-24 09:20:51.480533: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2022-01-24 09:20:51.480596: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.<jupyter_text>Create Environment<jupyter_code>seed_everything(42)
env = gym.make("LunarLander-v2")
env.seed(42)<jupyter_output><empty_output><jupyter_text>Train Agent<jupyter_code>#@title Agent Hyperparameters { run: "auto" }
lr = 0.0001 #@param {type:"number"}
gamma = 0.99 #@param {type:"number"}
entropy_beta = 0.01 #@param {type:"number"}
reward_steps = 50 #@param {type:"integer"}
clip_grad = 1 #@param {type:"number"}
training_episodes = 20000 #@param {type:"integer"}
mean_stopping = True #@param {type:"boolean"}
model = A2C(env, lr, gamma, entropy_beta, reward_steps, clip_grad)
model.train(training_episodes, mean_stopping)
wandb.finish()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup