Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation pipeline #827

Merged
merged 6 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
autosummary_generate = True

nb_execution_mode = os.getenv("NB_EXECUTION_MODE", "cache")
nb_execution_timeout = 120
nb_execution_timeout = 200
nb_merge_streams = True
nb_output_stderr = "remove"
nb_execution_raise_on_error = True
Expand Down
59 changes: 51 additions & 8 deletions docs/tutorials/3_train_gail.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@
"source": [
"Now we are ready to set up our GAIL trainer.\n",
"Note, that the `reward_net` is actually the network of the discriminator.\n",
"We evaluate the learner before and after training so we can see if it made any progress."
"We evaluate the learner before and after training so we can see if it made any progress.\n",
"\n",
"First we construct a GAIL trainer ..."
]
},
{
Expand Down Expand Up @@ -117,16 +119,57 @@
" venv=env,\n",
" gen_algo=learner,\n",
" reward_net=reward_net,\n",
")\n",
"\n",
"# evaluate the learner before training\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"... then we evaluate it before training ..."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"env.seed(SEED)\n",
"learner_rewards_before_training, _ = evaluate_policy(\n",
" learner, env, 100, return_episode_rewards=True\n",
")\n",
"\n",
"# train the learner and evaluate again\n",
"gail_trainer.train(200_000)\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"... and train it ..."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gail_trainer.train(200_000)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"... and finally evaluate it again."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"env.seed(SEED)\n",
"learner_rewards_after_training, _ = evaluate_policy(\n",
" learner, env, 100, return_episode_rewards=True\n",
Expand Down
31 changes: 19 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
]
PYTYPE = ["pytype==2023.9.27"] if IS_NOT_WINDOWS else []

HYPOTHESIS = ["hypothesis~=6.54.1"]

# Note: the versions of the test and doc requirements should be tightly pinned to known
# working versions to make our CI/CD pipeline as stable as possible.
TESTS_REQUIRE = (
Expand All @@ -36,7 +38,6 @@
"flake8-debugger~=4.1.2",
"flake8-docstrings~=1.6.0",
"flake8-isort~=4.1.2",
"hypothesis~=6.54.1",
"ipykernel~=6.15.1",
"jupyter~=1.0.0",
# TODO: upgrade jupyter-client once
Expand All @@ -58,18 +59,24 @@
+ PARALLEL_REQUIRE
+ ATARI_REQUIRE
+ PYTYPE
+ HYPOTHESIS
)
DOCS_REQUIRE = (
[
"sphinx~=5.1.1",
"sphinx-autodoc-typehints~=1.19.1",
"sphinx-rtd-theme~=1.0.0",
"sphinxcontrib-napoleon==0.7",
"furo==2022.6.21",
"sphinx-copybutton==0.5.0",
"sphinx-github-changelog~=1.2.0",
"myst-nb==0.17.2",
"ipykernel~=6.15.2",
]
+ ATARI_REQUIRE
+ PARALLEL_REQUIRE
+ HYPOTHESIS
)
DOCS_REQUIRE = [
"sphinx~=5.1.1",
"sphinx-autodoc-typehints~=1.19.1",
"sphinx-rtd-theme~=1.0.0",
"sphinxcontrib-napoleon==0.7",
"furo==2022.6.21",
"sphinx-copybutton==0.5.0",
"sphinx-github-changelog~=1.2.0",
"myst-nb==0.17.2",
"ipykernel~=6.15.2",
] + ATARI_REQUIRE


def get_readme() -> str:
Expand Down