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
Improve tutorial and example overviews #291
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
btjanaka
changed the title
Edit tutorials to improve their flow
Edit tutorials to improve flow
Jan 5, 2023
* Remove optimizers from examples * Unused import * Fix es docstring * Rename opt to _opt * History
btjanaka
force-pushed
the
docs/tutorial-reframe
branch
from
January 12, 2023 02:42
f4b4276
to
07257cc
Compare
btjanaka
changed the title
Edit tutorials to improve flow
Edit tutorial and example overviews
Jan 12, 2023
btjanaka
changed the title
Edit tutorial and example overviews
Improve tutorial and example overviews
Jan 12, 2023
This was referenced Jan 12, 2023
btjanaka
added a commit
that referenced
this pull request
Jan 14, 2023
## Description <!-- Provide a brief description of the PR's purpose here. --> We update the tutorial so that it is in line with the new tutorial structure in #291. We also expand the features demonstrated in this tutorial. Depends on #291 and #295 ### moviepy woes **Update:** It turns out this was all due to the decorator module not being loaded properly; see Zulko/moviepy#1625 -- we just have to reload decorator so that moviepy imports it correctly. One notable issue was that the tutorial needed ffmpeg to be installed in order to generate videos; this happens because the new Gymansium depends on moviepy for video recording, which in turn depends on ffmpeg. This is not a problem for Colab users as ffmpeg is already installed there, but local users may encounter frustration -- the video generation happens after the run, so they may do the run, wait for 2 hours, and then see that the videos fail. The steps that fail are as follows: 1. Create a Conda environment with Python 3.7 and activate it. 2. Install the package with `pip install -e .[visualize]` 3. Install jupyterlab with `pip install jupyterlab` 4. Start jupyterlab and run the notebook. 5. Leads to error on first `display_video` line with message looking like: ``` 86 '-s', '%dx%d' % (size[0], size[1]), 87 '-pix_fmt', 'rgba' if withmask else 'rgb24', ---> 88 '-r', '%.02f' % fps, 89 '-an', '-i', '-' 90 ] TypeError: must be real number, not NoneType ``` It appears that if you re-run the notebook without changing anything, everything then works, perhaps because `imageio_ffmpeg` has had time to load its ffmpeg executable (under the hood moviepy uses `imageio_ffmpeg` to get ffmpeg). I tried to see if we could overcome this by loading the ffmpeg executable early on, but it did not work: ```python import imageio_ffmpeg imageio_ffmpeg.get_ffmpeg_exe() ``` I also tried installing moviepy beforehand, so if it is installed before running the notebook, everything works. ## TODO <!-- Notable points that this PR has either accomplished or will accomplish. --> - [x] Update tutorial to reference the lunar lander MAE tutorial - [x] Log QD score in tutorial - [x] Add CQD score to tutorial -> doesn't fit - [x] Cut back on notes - [x] Link to documentation for features when mentioning them - [x] Show `best_elite` - [x] Explain elites_with_measures - [x] Explain two-stage improvement ranking - [x] Make sure the imports are still correct after changes - [x] Add QD score offset (find paper which explains offsets) - [x] Replace all `latest` links with `stable` (links will be broken but it's okay) - [x] Rerun the tutorial to have consistent images ## Questions <!-- Any concerns or points of confusion? --> ## Status - [x] I have read the guidelines in [CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md) - [x] I have formatted my code using `yapf` - [x] I have tested my code by running `pytest` - [x] I have linted my code with `pylint` - [x] I have added a one-line description of my change to the changelog in `HISTORY.md` - [x] This PR is ready to go
btjanaka
added a commit
that referenced
this pull request
Jan 17, 2023
## Description <!-- Provide a brief description of the PR's purpose here. --> As was introduced in #291, this tutorial shows how to run CMA-MAE with the lunar lander. ## TODO <!-- Notable points that this PR has either accomplished or will accomplish. --> - [x] Edit CMA-MAE tutorial - [x] Edit lunar lander tutorial to match - [x] Run through CONTRIBUTING checklist for CMA-MAE ## Questions <!-- Any concerns or points of confusion? --> ## Status - [x] I have read the guidelines in [CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md) - [x] I have formatted my code using `yapf` - [x] I have tested my code by running `pytest` - [x] I have linted my code with `pylint` - [x] ~I have added a one-line description of my change to the changelog in `HISTORY.md`~ - [x] This PR is ready to go
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Various updates to tutorials to fit the new release of pyribs. This PR reframes the tutorials and examples, and there will be several followup PRs to implement and smooth out all the tutorials.
TODO
Questions
Status
yapf
pytest
pylint
HISTORY.md