<jupyter_start><jupyter_text>General Notes> Notes about using jupyter, openai gymsFor starters, if you use the dockerfile provided, you will notice that the `xvfb` package is being used. This is needed to allow many of the gyms to run properly. Below is an example of running a env in a jupyter notebook.<jupyter_code># hide
import gym
from IPython import display
import PIL.Image
%matplotlib inline

env=gym.make('CartPole-v1')
env.reset()
for _ in range(200):
    display.clear_output(wait=True)
    display.display(PIL.Image.fromarray(env.render(mode='rgb_array')))
    s,r,d,_=env.step(env.action_space.sample())
    if d:env.reset()
# hide
env = gym.make('Breakout-v0')
env.reset()
for _ in range(800):
    display.clear_output(wait=True)
    display.display(PIL.Image.fromarray(env.render(mode='rgb_array')))
    s,r,d,_=env.step(env.action_space.sample())
    if d:env.reset()
# hide
from nbdev.export import *
from nbdev.export2html import *
notebook2script()
notebook2html()<jupyter_output>Converted 00_core.ipynb.
Converted 01_wrappers.ipynb.
Converted 03_basic_agents.ipynb.
Converted 04_learner.ipynb.
Converted 05a_data.ipynb.
Converted 05b_async_data.ipynb.
Converted 06_basic_train.ipynb.
Converted 13_metrics.ipynb.
Converted 14_actorcritic.sac.ipynb.
Converted 15_actorcritic.a3c_data.ipynb.
Converted 16_actorcritic.a2c.ipynb.
Converted index.ipynb.
Converted notes.ipynb.
{'fraction_non_alphanumeric': 0.10719424460431655, 'fraction_numerical': 0.025179856115107913, 'mean_word_length': 5.469767441860465, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '532009', 'license': 'Apache-2.0', 'n_tokens_mistral': 549, 'n_tokens_neox': 519, 'n_words': 116, 'path': 'nbs/notes.ipynb', 'repo_name': 'tyoc213-contrib/fast-reinforcement-learning-2', 'size': '1390'}