Skip to content

Commit

Permalink
Add policy gradient, reduce steps for runtime, fix PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
m-naumann committed Dec 21, 2024
1 parent 75136f4 commit 41cabce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
schedule:
- cron: "0 3 * * 1" # Run every Monday 3 am

permissions:
pull-requests: write

jobs:
ci:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -62,10 +65,15 @@ jobs:
publish_branch: gh-pages
keep_files: true # Retain other content on gh-pages

- name: Add PR comment with preview link
- name: Add PR note
if: github.event_name == 'pull_request'
run: |
echo "Deployed [https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-${{ github.event.pull_request.number }}/](temporary docs)."
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
### :books: Docs
Created [https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-${{ github.event.pull_request.number }}/](temporary docs).
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ nav:
- Decision Making:
- Value Iteration: notebooks/mdp_value_iteration.ipynb
- Q-Learning: notebooks/mdp_q_learning.ipynb
- Policy Gradient: notebooks/mdp_policy_gradient.ipynb
- API Documentation (partial): reference/

plugins:
Expand Down
8 changes: 4 additions & 4 deletions notebooks/mdp_policy_gradient.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"model_checkpoints = policy_gradient(\n",
" mdp=grid_mdp,\n",
" policy=policy,\n",
" iterations=100,\n",
" iterations=10,\n",
" return_history=True,\n",
")"
]
Expand Down Expand Up @@ -107,7 +107,7 @@
" w = ipywidgets.interactive(plot_policy_step_grid_map, iteration=iteration_slider)\n",
" display(w)\n",
"else:\n",
" plot_policy_step_grid_map(100)"
" plot_policy_step_grid_map(10)"
]
},
{
Expand Down Expand Up @@ -161,7 +161,7 @@
"model_checkpoints = policy_gradient(\n",
" mdp=highway_mdp,\n",
" policy=policy,\n",
" iterations=200,\n",
" iterations=20,\n",
" return_history=True,\n",
")"
]
Expand Down Expand Up @@ -205,7 +205,7 @@
" w = ipywidgets.interactive(plot_policy_step_grid_map, iteration=iteration_slider)\n",
" display(w)\n",
"else:\n",
" plot_policy_step_grid_map(200)"
" plot_policy_step_grid_map(20)"
]
}
],
Expand Down

0 comments on commit 41cabce

Please sign in to comment.