Skip to content

Commit

Permalink
Fix formatting in 7_train_density.ipynb and density.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
michalzajac-ml committed Sep 6, 2023
1 parent 5449404 commit 2dcc6cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
7 changes: 1 addition & 6 deletions docs/algorithms/density.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ Detailed example notebook: :doc:`../tutorials/7_train_density`
rollouts = serialize.load("../tests/testdata/expert_models/pendulum_0/rollouts/final.npz")

imitation_trainer = PPO(
ActorCriticPolicy,
env,
learning_rate=3e-4,
gamma=0.95,
ent_coef=1e-4,
n_steps=2048
ActorCriticPolicy, env, learning_rate=3e-4, gamma=0.95, ent_coef=1e-4, n_steps=2048
)
density_trainer = db.DensityAlgorithm(
venv=env,
Expand Down
11 changes: 2 additions & 9 deletions docs/tutorials/7_train_density.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,7 @@
"\n",
"\n",
"imitation_trainer = PPO(\n",
" ActorCriticPolicy, \n",
" env, \n",
" learning_rate=3e-4,\n",
" gamma=0.95,\n",
" ent_coef=1e-4,\n",
" n_steps=2048\n",
" ActorCriticPolicy, env, learning_rate=3e-4, gamma=0.95, ent_coef=1e-4, n_steps=2048\n",
")\n",
"density_trainer = db.DensityAlgorithm(\n",
" venv=env,\n",
Expand All @@ -115,9 +110,7 @@
"outputs": [],
"source": [
"# evaluate the expert\n",
"expert_rewards, _ = evaluate_policy(\n",
" expert, env, 100, return_episode_rewards=True\n",
")\n",
"expert_rewards, _ = evaluate_policy(expert, env, 100, return_episode_rewards=True)\n",
"\n",
"# evaluate the learner before training\n",
"learner_rewards_before_training, _ = evaluate_policy(\n",
Expand Down

0 comments on commit 2dcc6cd

Please sign in to comment.