diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f92cc7d29..614a526e5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,20 +10,21 @@ repos: - id: check-docstring-first - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.1.0 hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: v1.12.0 + rev: 1.13.0 hooks: - id: blacken-docs - additional_dependencies: [black==21.12b0] + additional_dependencies: [black==23.1.0] -- repo: https://gitlab.com/pycqa/flake8 - rev: 4.0.1 +- repo: https://github.com/pycqa/flake8 + rev: 6.0.0 hooks: - id: flake8 additional_dependencies: [flake8-docstrings] types: [file, python] + exclude: (.*/__init__.py|rlberry/check_packages.py) args: ['--select=F401,F405,D410,D411,D412'] diff --git a/CITATION.cff b/CITATION.cff index dc5d52858..7a01b4754 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -19,4 +19,4 @@ abbreviation: rlberry version: 0.2.2-dev doi: 10.5281/zenodo.5223307 date-released: 2021-10-01 -url: "https://github.com/rlberry-py/rlberry" \ No newline at end of file +url: "https://github.com/rlberry-py/rlberry" diff --git a/README.md b/README.md index 3fd606d6f..c3567ee55 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ A Reinforcement Learning Library for Research and Education

+

diff --git a/assets/logo_square.svg b/assets/logo_square.svg index 7c6feb1a7..747f7aea7 100644 --- a/assets/logo_square.svg +++ b/assets/logo_square.svg @@ -49,4 +49,4 @@ - \ No newline at end of file + diff --git a/assets/logo_wide.svg b/assets/logo_wide.svg index 09d0e20ab..a510b73ad 100644 --- a/assets/logo_wide.svg +++ b/assets/logo_wide.svg @@ -49,4 +49,4 @@ - \ No newline at end of file + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 916bee798..4cc1d072f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,8 +10,6 @@ pr: - rlberry/_version.py - docs - - jobs: - job: 'checkPrLabel' @@ -74,29 +72,6 @@ jobs: ./codecov displayName: 'Upload to codecov.io' -- job: 'Formatting' - dependsOn: checkPrLabel - condition: or(in(variables['Build.SourceBranch'], 'refs/heads/main'), eq(dependencies.checkPrLabel.outputs['checkPrLabel.prHasCILabel'], true)) - - pool: - vmImage: ubuntu-latest - strategy: - matrix: - Python39: - python.version: '3.9' - - steps: - - script: | - python -m pip install --upgrade pip - pip install black flake8 flake8-docstrings - black --check examples rlberry *py - displayName: "black" - - script: | - # ensure there is no unused imports with - flake8 --select F401,F405,D410,D411,D412 --exclude=rlberry/check_packages.py --per-file-ignores="__init__.py:F401" - displayName: 'flake8' - - - job: 'macOS' dependsOn: checkPrLabel diff --git a/docs/basics/DeepRLTutorial/TutorialDeepRL.rst b/docs/basics/DeepRLTutorial/TutorialDeepRL.rst index 8a964730d..129c7c395 100644 --- a/docs/basics/DeepRLTutorial/TutorialDeepRL.rst +++ b/docs/basics/DeepRLTutorial/TutorialDeepRL.rst @@ -2,7 +2,7 @@ Quickstart for Deep Reinforcement Learning in rlberry ===================================================== .. highlight:: none - + .. Authors: Riccardo Della Vecchia, Hector Kohler, Alena Shilova. diff --git a/docs/basics/compare_agents.rst b/docs/basics/compare_agents.rst index c4002f755..8bcfbfe9c 100644 --- a/docs/basics/compare_agents.rst +++ b/docs/basics/compare_agents.rst @@ -7,7 +7,7 @@ Compare different agents ======================== -Two or more agents can be compared using the classes +Two or more agents can be compared using the classes :class:`~rlberry.manager.agent_manager.AgentManager` and :class:`~rlberry.manager.multiple_managers.MultipleManagers`, as in the example below. @@ -26,14 +26,14 @@ Two or more agents can be compared using the classes # Parameters params = {} - params['reinforce'] = dict( - gamma=0.99, - horizon=160, + params["reinforce"] = dict( + gamma=0.99, + horizon=160, ) - params['kernel'] = dict( - gamma=0.99, - horizon=160, + params["kernel"] = dict( + gamma=0.99, + horizon=160, ) eval_kwargs = dict(eval_horizon=200) @@ -41,29 +41,31 @@ Two or more agents can be compared using the classes # Create AgentManager for REINFORCE and RSKernelUCBVI multimanagers = MultipleManagers() multimanagers.append( - AgentManager( + AgentManager( REINFORCEAgent, env, - init_kwargs=params['reinforce'], + init_kwargs=params["reinforce"], fit_budget=100, n_fit=4, - parallelization='thread') + parallelization="thread", + ) ) multimanagers.append( - AgentManager( + AgentManager( RSKernelUCBVIAgent, env, - init_kwargs=params['kernel'], + init_kwargs=params["kernel"], fit_budget=100, n_fit=4, - parallelization='thread') + parallelization="thread", + ) ) # Fit and plot multimanagers.run() plot_writer_data( - multimanagers.managers, - tag='episode_rewards', - preprocess_func=np.cumsum, - title="Cumulative Rewards") - + multimanagers.managers, + tag="episode_rewards", + preprocess_func=np.cumsum, + title="Cumulative Rewards", + ) diff --git a/docs/basics/create_agent.rst b/docs/basics/create_agent.rst index 47d1a89cd..86a899743 100644 --- a/docs/basics/create_agent.rst +++ b/docs/basics/create_agent.rst @@ -9,7 +9,7 @@ Create an agent rlberry_ requires you to use a **very simple interface** to write agents, with basically two methods to implement: :code:`fit()` and :code:`eval()`. -The example below shows how to create an agent. +The example below shows how to create an agent. .. code-block:: python @@ -17,27 +17,25 @@ The example below shows how to create an agent. import numpy as np from rlberry.agents import Agent - class MyAgent(Agent): + class MyAgent(Agent): name = "MyAgent" - def __init__(self, - env, - param1=0.99, - param2=1e-5, - **kwargs): # it's important to put **kwargs to ensure compatibility with the base class - # self.env is initialized in the base class - # An evaluation environment is also initialized: self.eval_env - Agent.__init__(self, env, **kwargs) + def __init__( + self, env, param1=0.99, param2=1e-5, **kwargs + ): # it's important to put **kwargs to ensure compatibility with the base class + # self.env is initialized in the base class + # An evaluation environment is also initialized: self.eval_env + Agent.__init__(self, env, **kwargs) - self.param1 = param1 - self.param2 = param2 + self.param1 = param1 + self.param2 = param2 - def fit(self, budget, **kwargs): + def fit(self, budget, **kwargs): """ The parameter budget can represent the number of steps, the number of episodes etc, depending on the agent. - * Interact with the environment (self.env); + * Interact with the environment (self.env); * Train the agent * Return useful information """ @@ -48,16 +46,16 @@ The example below shows how to create an agent. state = self.env.reset() done = False while not done: - action = ... - next_state, reward, done, _ = self.env.step(action) - rewards[ep] += reward + action = ... + next_state, reward, done, _ = self.env.step(action) + rewards[ep] += reward - info = {'episode_rewards': rewards} + info = {"episode_rewards": rewards} return info def eval(self, **kwargs): """ - Returns a value corresponding to the evaluation of the agent on the + Returns a value corresponding to the evaluation of the agent on the evaluation environment. For instance, it can be a Monte-Carlo evaluation of the policy learned in fit(). @@ -65,9 +63,9 @@ The example below shows how to create an agent. return 0.0 -.. note:: It's important that your agent accepts optional `**kwargs` and pass it to the base class as :code:`Agent.__init__(self, env, **kwargs)`. +.. note:: It's important that your agent accepts optional `**kwargs` and pass it to the base class as :code:`Agent.__init__(self, env, **kwargs)`. .. seealso:: - Documentation of the classes :class:`~rlberry.agents.agent.Agent` + Documentation of the classes :class:`~rlberry.agents.agent.Agent` and :class:`~rlberry.agents.agent.AgentWithSimplePolicy`. diff --git a/docs/basics/evaluate_agent.rst b/docs/basics/evaluate_agent.rst index 0d9921771..3bf117fa4 100644 --- a/docs/basics/evaluate_agent.rst +++ b/docs/basics/evaluate_agent.rst @@ -20,7 +20,7 @@ as shown in the examples below. # Environment (constructor, kwargs) - env = (gym_make, dict(id='CartPole-v1')) + env = (gym_make, dict(id="CartPole-v1")) # Initial set of parameters params = dict( @@ -41,14 +41,15 @@ as shown in the examples below. eval_kwargs=eval_kwargs, fit_budget=fit_budget, n_fit=4, - parallelization='thread') + parallelization="thread", + ) # Fit the 4 instances stats.fit() # The fit() method of REINFORCEAgent logs data to a :class:`~rlberry.utils.writers.DefaultWriter` # object. The method below can be used to plot those data! - plot_writer_data(stats, tag='episode_rewards') + plot_writer_data(stats, tag="episode_rewards") @@ -72,17 +73,17 @@ For :class:`~rlberry.agents.reinforce.reinforce.REINFORCEAgent`, this method loo ---------- trial: optuna.trial """ - batch_size = trial.suggest_categorical('batch_size', [1, 4, 8, 16, 32]) - gamma = trial.suggest_categorical('gamma', [0.9, 0.95, 0.99]) - learning_rate = trial.suggest_loguniform('learning_rate', 1e-5, 1) - entr_coef = trial.suggest_loguniform('entr_coef', 1e-8, 0.1) + batch_size = trial.suggest_categorical("batch_size", [1, 4, 8, 16, 32]) + gamma = trial.suggest_categorical("gamma", [0.9, 0.95, 0.99]) + learning_rate = trial.suggest_loguniform("learning_rate", 1e-5, 1) + entr_coef = trial.suggest_loguniform("entr_coef", 1e-8, 0.1) return { - 'batch_size': batch_size, - 'gamma': gamma, - 'learning_rate': learning_rate, - 'entr_coef': entr_coef, - } + "batch_size": batch_size, + "gamma": gamma, + "learning_rate": learning_rate, + "entr_coef": entr_coef, + } Now we can use the :meth:`optimize_hyperparams` method @@ -93,13 +94,13 @@ of :class:`~rlberry.manager.agent_manager.AgentManager` to find good parameters # Run optimization and print results stats.optimize_hyperparams( n_trials=100, - timeout=10, # stop after 10 seconds + timeout=10, # stop after 10 seconds n_fit=2, - sampler_method='optuna_default' + sampler_method="optuna_default", ) print(stats.best_hyperparams) # Calling fit() again will train the agent with the optimized parameters stats.fit() - plot_writer_data(stats, tag='episode_rewards') + plot_writer_data(stats, tag="episode_rewards") diff --git a/docs/basics/quick_start_rl/quickstart.rst b/docs/basics/quick_start_rl/quickstart.rst index 9aaaf3489..e3c9ea604 100644 --- a/docs/basics/quick_start_rl/quickstart.rst +++ b/docs/basics/quick_start_rl/quickstart.rst @@ -1,7 +1,7 @@ .. _quick_start: .. highlight:: none - + Quick Start for Reinforcement Learning in rlberry ================================================= @@ -60,7 +60,7 @@ Let us see a graphical representation .. parsed-literal:: - + ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11.2.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3 diff --git a/docs/basics/rlberry how to.rst b/docs/basics/rlberry how to.rst index 10489b7bd..e5a6bbca5 100644 --- a/docs/basics/rlberry how to.rst +++ b/docs/basics/rlberry how to.rst @@ -12,7 +12,7 @@ Libraries .. parsed-literal:: - [INFO] No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate' + [INFO] No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate' Environment definition @@ -54,16 +54,16 @@ two algorithms. name = 'RandomAgent' def __init__(self, env, **kwargs): AgentWithSimplePolicy.__init__(self, env, **kwargs) - + def fit(self, budget=None, **kwargs): pass - + def policy(self, observation): return self.env.action_space.sample() - + # We will compare this agent to V - - + + # Define parameters vi_params = {'gamma':0.1, 'epsilon':1e-3} @@ -95,7 +95,7 @@ our estimation. init_kwargs=vi_params, n_fit=1) vi_stats.fit() - + # Create AgentManager for baseline baseline_stats = AgentManager( RandomAgent, @@ -108,10 +108,10 @@ our estimation. .. parsed-literal:: - [INFO] Running AgentManager fit() for ValueIteration... - [INFO] ... trained! - [INFO] Running AgentManager fit() for RandomAgent... - [INFO] ... trained! + [INFO] Running AgentManager fit() for ValueIteration... + [INFO] ... trained! + [INFO] Running AgentManager fit() for RandomAgent... + [INFO] ... trained! .. code:: ipython3 @@ -121,28 +121,28 @@ our estimation. .. parsed-literal:: - [INFO] Evaluating ValueIteration... - [INFO] [eval]... simulation 1/10 - [INFO] [eval]... simulation 2/10 - [INFO] [eval]... simulation 3/10 - [INFO] [eval]... simulation 4/10 - [INFO] [eval]... simulation 5/10 - [INFO] [eval]... simulation 6/10 - [INFO] [eval]... simulation 7/10 - [INFO] [eval]... simulation 8/10 - [INFO] [eval]... simulation 9/10 - [INFO] [eval]... simulation 10/10 - [INFO] Evaluating RandomAgent... - [INFO] [eval]... simulation 1/10 - [INFO] [eval]... simulation 2/10 - [INFO] [eval]... simulation 3/10 - [INFO] [eval]... simulation 4/10 - [INFO] [eval]... simulation 5/10 - [INFO] [eval]... simulation 6/10 - [INFO] [eval]... simulation 7/10 - [INFO] [eval]... simulation 8/10 - [INFO] [eval]... simulation 9/10 - [INFO] [eval]... simulation 10/10 + [INFO] Evaluating ValueIteration... + [INFO] [eval]... simulation 1/10 + [INFO] [eval]... simulation 2/10 + [INFO] [eval]... simulation 3/10 + [INFO] [eval]... simulation 4/10 + [INFO] [eval]... simulation 5/10 + [INFO] [eval]... simulation 6/10 + [INFO] [eval]... simulation 7/10 + [INFO] [eval]... simulation 8/10 + [INFO] [eval]... simulation 9/10 + [INFO] [eval]... simulation 10/10 + [INFO] Evaluating RandomAgent... + [INFO] [eval]... simulation 1/10 + [INFO] [eval]... simulation 2/10 + [INFO] [eval]... simulation 3/10 + [INFO] [eval]... simulation 4/10 + [INFO] [eval]... simulation 5/10 + [INFO] [eval]... simulation 6/10 + [INFO] [eval]... simulation 7/10 + [INFO] [eval]... simulation 8/10 + [INFO] [eval]... simulation 9/10 + [INFO] [eval]... simulation 10/10 @@ -163,7 +163,7 @@ array name = 'RandomAgent2' def __init__(self, env, **kwargs): super().__init__(env, **kwargs) - + def eval(self, eval_horizon=10 ** 5, **kwargs): @@ -175,13 +175,13 @@ array observation, reward, done, _ = self.eval_env.step(action) episode_regret[tt] = 1-reward # Optimal reward is 1 return episode_regret - - + + class ValueIterationAgent2(ValueIterationAgent): name = 'ValueIterationAgent2' def __init__(self, env, gamma=0.95, horizon=None, epsilon=1e-6, **kwargs): super().__init__( env, gamma=0.95, horizon=None, epsilon=1e-6, **kwargs) - + def eval(self, eval_horizon=10 ** 5, gamma=1, @@ -193,7 +193,7 @@ array action = self.policy(observation) observation, reward, done, _ = self.eval_env.step(action) episode_regret[tt] = 1-reward # Optimal reward is 1 - + return episode_regret Then, we do the Monte-Carlo simulations. This time, we directly do 100 @@ -212,7 +212,7 @@ the variability of our estimation). init_kwargs=vi_params, n_fit=4) vi_stats.fit() - + # Create AgentManager for baseline baseline_stats = AgentManager( RandomAgent2, @@ -225,10 +225,10 @@ the variability of our estimation). .. parsed-literal:: - [INFO] Running AgentManager fit() for ValueIterationAgent2... - [INFO] ... trained! - [INFO] Running AgentManager fit() for RandomAgent2... - [INFO] ... trained! + [INFO] Running AgentManager fit() for ValueIterationAgent2... + [INFO] ... trained! + [INFO] Running AgentManager fit() for RandomAgent2... + [INFO] ... trained! .. code:: ipython3 @@ -238,208 +238,208 @@ the variability of our estimation). .. parsed-literal:: - [INFO] Evaluating ValueIterationAgent2... - [INFO] [eval]... simulation 1/100 - [INFO] [eval]... simulation 2/100 - [INFO] [eval]... simulation 3/100 - [INFO] [eval]... simulation 4/100 - [INFO] [eval]... simulation 5/100 - [INFO] [eval]... simulation 6/100 - [INFO] [eval]... simulation 7/100 - [INFO] [eval]... simulation 8/100 - [INFO] [eval]... simulation 9/100 - [INFO] [eval]... simulation 10/100 - [INFO] [eval]... simulation 11/100 - [INFO] [eval]... simulation 12/100 - [INFO] [eval]... simulation 13/100 - [INFO] [eval]... simulation 14/100 - [INFO] [eval]... simulation 15/100 - [INFO] [eval]... simulation 16/100 - [INFO] [eval]... simulation 17/100 - [INFO] [eval]... simulation 18/100 - [INFO] [eval]... simulation 19/100 - [INFO] [eval]... simulation 20/100 - [INFO] [eval]... simulation 21/100 - [INFO] [eval]... simulation 22/100 - [INFO] [eval]... simulation 23/100 - [INFO] [eval]... simulation 24/100 - [INFO] [eval]... simulation 25/100 - [INFO] [eval]... simulation 26/100 - [INFO] [eval]... simulation 27/100 - [INFO] [eval]... simulation 28/100 - [INFO] [eval]... simulation 29/100 - [INFO] [eval]... simulation 30/100 - [INFO] [eval]... simulation 31/100 - [INFO] [eval]... simulation 32/100 - [INFO] [eval]... simulation 33/100 - [INFO] [eval]... simulation 34/100 - [INFO] [eval]... simulation 35/100 - [INFO] [eval]... simulation 36/100 - [INFO] [eval]... simulation 37/100 - [INFO] [eval]... simulation 38/100 - [INFO] [eval]... simulation 39/100 - [INFO] [eval]... simulation 40/100 - [INFO] [eval]... simulation 41/100 - [INFO] [eval]... simulation 42/100 - [INFO] [eval]... simulation 43/100 - [INFO] [eval]... simulation 44/100 - [INFO] [eval]... simulation 45/100 - [INFO] [eval]... simulation 46/100 - [INFO] [eval]... simulation 47/100 - [INFO] [eval]... simulation 48/100 - [INFO] [eval]... simulation 49/100 - [INFO] [eval]... simulation 50/100 - [INFO] [eval]... simulation 51/100 - [INFO] [eval]... simulation 52/100 - [INFO] [eval]... simulation 53/100 - [INFO] [eval]... simulation 54/100 - [INFO] [eval]... simulation 55/100 - [INFO] [eval]... simulation 56/100 - [INFO] [eval]... simulation 57/100 - [INFO] [eval]... simulation 58/100 - [INFO] [eval]... simulation 59/100 - [INFO] [eval]... simulation 60/100 - [INFO] [eval]... simulation 61/100 - [INFO] [eval]... simulation 62/100 - [INFO] [eval]... simulation 63/100 - [INFO] [eval]... simulation 64/100 - [INFO] [eval]... simulation 65/100 - [INFO] [eval]... simulation 66/100 - [INFO] [eval]... simulation 67/100 - [INFO] [eval]... simulation 68/100 - [INFO] [eval]... simulation 69/100 - [INFO] [eval]... simulation 70/100 - [INFO] [eval]... simulation 71/100 - [INFO] [eval]... simulation 72/100 - [INFO] [eval]... simulation 73/100 - [INFO] [eval]... simulation 74/100 - [INFO] [eval]... simulation 75/100 - [INFO] [eval]... simulation 76/100 - [INFO] [eval]... simulation 77/100 - [INFO] [eval]... simulation 78/100 - [INFO] [eval]... simulation 79/100 - [INFO] [eval]... simulation 80/100 - [INFO] [eval]... simulation 81/100 - [INFO] [eval]... simulation 82/100 - [INFO] [eval]... simulation 83/100 - [INFO] [eval]... simulation 84/100 - [INFO] [eval]... simulation 85/100 - [INFO] [eval]... simulation 86/100 - [INFO] [eval]... simulation 87/100 - [INFO] [eval]... simulation 88/100 - [INFO] [eval]... simulation 89/100 - [INFO] [eval]... simulation 90/100 - [INFO] [eval]... simulation 91/100 - [INFO] [eval]... simulation 92/100 - [INFO] [eval]... simulation 93/100 - [INFO] [eval]... simulation 94/100 - [INFO] [eval]... simulation 95/100 - [INFO] [eval]... simulation 96/100 - [INFO] [eval]... simulation 97/100 - [INFO] [eval]... simulation 98/100 - [INFO] [eval]... simulation 99/100 - [INFO] [eval]... simulation 100/100 - [INFO] Evaluating RandomAgent2... - [INFO] [eval]... simulation 1/100 - [INFO] [eval]... simulation 2/100 - [INFO] [eval]... simulation 3/100 - [INFO] [eval]... simulation 4/100 - [INFO] [eval]... simulation 5/100 - [INFO] [eval]... simulation 6/100 - [INFO] [eval]... simulation 7/100 - [INFO] [eval]... simulation 8/100 - [INFO] [eval]... simulation 9/100 - [INFO] [eval]... simulation 10/100 - [INFO] [eval]... simulation 11/100 - [INFO] [eval]... simulation 12/100 - [INFO] [eval]... simulation 13/100 - [INFO] [eval]... simulation 14/100 - [INFO] [eval]... simulation 15/100 - [INFO] [eval]... simulation 16/100 - [INFO] [eval]... simulation 17/100 - [INFO] [eval]... simulation 18/100 - [INFO] [eval]... simulation 19/100 - [INFO] [eval]... simulation 20/100 - [INFO] [eval]... simulation 21/100 - [INFO] [eval]... simulation 22/100 - [INFO] [eval]... simulation 23/100 - [INFO] [eval]... simulation 24/100 - [INFO] [eval]... simulation 25/100 - [INFO] [eval]... simulation 26/100 - [INFO] [eval]... simulation 27/100 - [INFO] [eval]... simulation 28/100 - [INFO] [eval]... simulation 29/100 - [INFO] [eval]... simulation 30/100 - [INFO] [eval]... simulation 31/100 - [INFO] [eval]... simulation 32/100 - [INFO] [eval]... simulation 33/100 - [INFO] [eval]... simulation 34/100 - [INFO] [eval]... simulation 35/100 - [INFO] [eval]... simulation 36/100 - [INFO] [eval]... simulation 37/100 - [INFO] [eval]... simulation 38/100 - [INFO] [eval]... simulation 39/100 - [INFO] [eval]... simulation 40/100 - [INFO] [eval]... simulation 41/100 - [INFO] [eval]... simulation 42/100 - [INFO] [eval]... simulation 43/100 - [INFO] [eval]... simulation 44/100 - [INFO] [eval]... simulation 45/100 - [INFO] [eval]... simulation 46/100 - [INFO] [eval]... simulation 47/100 - [INFO] [eval]... simulation 48/100 - [INFO] [eval]... simulation 49/100 - [INFO] [eval]... simulation 50/100 - [INFO] [eval]... simulation 51/100 - [INFO] [eval]... simulation 52/100 - [INFO] [eval]... simulation 53/100 - [INFO] [eval]... simulation 54/100 - [INFO] [eval]... simulation 55/100 - [INFO] [eval]... simulation 56/100 - [INFO] [eval]... simulation 57/100 - [INFO] [eval]... simulation 58/100 - [INFO] [eval]... simulation 59/100 - [INFO] [eval]... simulation 60/100 - [INFO] [eval]... simulation 61/100 - [INFO] [eval]... simulation 62/100 - [INFO] [eval]... simulation 63/100 - [INFO] [eval]... simulation 64/100 - [INFO] [eval]... simulation 65/100 - [INFO] [eval]... simulation 66/100 - [INFO] [eval]... simulation 67/100 - [INFO] [eval]... simulation 68/100 - [INFO] [eval]... simulation 69/100 - [INFO] [eval]... simulation 70/100 - [INFO] [eval]... simulation 71/100 - [INFO] [eval]... simulation 72/100 - [INFO] [eval]... simulation 73/100 - [INFO] [eval]... simulation 74/100 - [INFO] [eval]... simulation 75/100 - [INFO] [eval]... simulation 76/100 - [INFO] [eval]... simulation 77/100 - [INFO] [eval]... simulation 78/100 - [INFO] [eval]... simulation 79/100 - [INFO] [eval]... simulation 80/100 - [INFO] [eval]... simulation 81/100 - [INFO] [eval]... simulation 82/100 - [INFO] [eval]... simulation 83/100 - [INFO] [eval]... simulation 84/100 - [INFO] [eval]... simulation 85/100 - [INFO] [eval]... simulation 86/100 - [INFO] [eval]... simulation 87/100 - [INFO] [eval]... simulation 88/100 - [INFO] [eval]... simulation 89/100 - [INFO] [eval]... simulation 90/100 - [INFO] [eval]... simulation 91/100 - [INFO] [eval]... simulation 92/100 - [INFO] [eval]... simulation 93/100 - [INFO] [eval]... simulation 94/100 - [INFO] [eval]... simulation 95/100 - [INFO] [eval]... simulation 96/100 - [INFO] [eval]... simulation 97/100 - [INFO] [eval]... simulation 98/100 - [INFO] [eval]... simulation 99/100 - [INFO] [eval]... simulation 100/100 + [INFO] Evaluating ValueIterationAgent2... + [INFO] [eval]... simulation 1/100 + [INFO] [eval]... simulation 2/100 + [INFO] [eval]... simulation 3/100 + [INFO] [eval]... simulation 4/100 + [INFO] [eval]... simulation 5/100 + [INFO] [eval]... simulation 6/100 + [INFO] [eval]... simulation 7/100 + [INFO] [eval]... simulation 8/100 + [INFO] [eval]... simulation 9/100 + [INFO] [eval]... simulation 10/100 + [INFO] [eval]... simulation 11/100 + [INFO] [eval]... simulation 12/100 + [INFO] [eval]... simulation 13/100 + [INFO] [eval]... simulation 14/100 + [INFO] [eval]... simulation 15/100 + [INFO] [eval]... simulation 16/100 + [INFO] [eval]... simulation 17/100 + [INFO] [eval]... simulation 18/100 + [INFO] [eval]... simulation 19/100 + [INFO] [eval]... simulation 20/100 + [INFO] [eval]... simulation 21/100 + [INFO] [eval]... simulation 22/100 + [INFO] [eval]... simulation 23/100 + [INFO] [eval]... simulation 24/100 + [INFO] [eval]... simulation 25/100 + [INFO] [eval]... simulation 26/100 + [INFO] [eval]... simulation 27/100 + [INFO] [eval]... simulation 28/100 + [INFO] [eval]... simulation 29/100 + [INFO] [eval]... simulation 30/100 + [INFO] [eval]... simulation 31/100 + [INFO] [eval]... simulation 32/100 + [INFO] [eval]... simulation 33/100 + [INFO] [eval]... simulation 34/100 + [INFO] [eval]... simulation 35/100 + [INFO] [eval]... simulation 36/100 + [INFO] [eval]... simulation 37/100 + [INFO] [eval]... simulation 38/100 + [INFO] [eval]... simulation 39/100 + [INFO] [eval]... simulation 40/100 + [INFO] [eval]... simulation 41/100 + [INFO] [eval]... simulation 42/100 + [INFO] [eval]... simulation 43/100 + [INFO] [eval]... simulation 44/100 + [INFO] [eval]... simulation 45/100 + [INFO] [eval]... simulation 46/100 + [INFO] [eval]... simulation 47/100 + [INFO] [eval]... simulation 48/100 + [INFO] [eval]... simulation 49/100 + [INFO] [eval]... simulation 50/100 + [INFO] [eval]... simulation 51/100 + [INFO] [eval]... simulation 52/100 + [INFO] [eval]... simulation 53/100 + [INFO] [eval]... simulation 54/100 + [INFO] [eval]... simulation 55/100 + [INFO] [eval]... simulation 56/100 + [INFO] [eval]... simulation 57/100 + [INFO] [eval]... simulation 58/100 + [INFO] [eval]... simulation 59/100 + [INFO] [eval]... simulation 60/100 + [INFO] [eval]... simulation 61/100 + [INFO] [eval]... simulation 62/100 + [INFO] [eval]... simulation 63/100 + [INFO] [eval]... simulation 64/100 + [INFO] [eval]... simulation 65/100 + [INFO] [eval]... simulation 66/100 + [INFO] [eval]... simulation 67/100 + [INFO] [eval]... simulation 68/100 + [INFO] [eval]... simulation 69/100 + [INFO] [eval]... simulation 70/100 + [INFO] [eval]... simulation 71/100 + [INFO] [eval]... simulation 72/100 + [INFO] [eval]... simulation 73/100 + [INFO] [eval]... simulation 74/100 + [INFO] [eval]... simulation 75/100 + [INFO] [eval]... simulation 76/100 + [INFO] [eval]... simulation 77/100 + [INFO] [eval]... simulation 78/100 + [INFO] [eval]... simulation 79/100 + [INFO] [eval]... simulation 80/100 + [INFO] [eval]... simulation 81/100 + [INFO] [eval]... simulation 82/100 + [INFO] [eval]... simulation 83/100 + [INFO] [eval]... simulation 84/100 + [INFO] [eval]... simulation 85/100 + [INFO] [eval]... simulation 86/100 + [INFO] [eval]... simulation 87/100 + [INFO] [eval]... simulation 88/100 + [INFO] [eval]... simulation 89/100 + [INFO] [eval]... simulation 90/100 + [INFO] [eval]... simulation 91/100 + [INFO] [eval]... simulation 92/100 + [INFO] [eval]... simulation 93/100 + [INFO] [eval]... simulation 94/100 + [INFO] [eval]... simulation 95/100 + [INFO] [eval]... simulation 96/100 + [INFO] [eval]... simulation 97/100 + [INFO] [eval]... simulation 98/100 + [INFO] [eval]... simulation 99/100 + [INFO] [eval]... simulation 100/100 + [INFO] Evaluating RandomAgent2... + [INFO] [eval]... simulation 1/100 + [INFO] [eval]... simulation 2/100 + [INFO] [eval]... simulation 3/100 + [INFO] [eval]... simulation 4/100 + [INFO] [eval]... simulation 5/100 + [INFO] [eval]... simulation 6/100 + [INFO] [eval]... simulation 7/100 + [INFO] [eval]... simulation 8/100 + [INFO] [eval]... simulation 9/100 + [INFO] [eval]... simulation 10/100 + [INFO] [eval]... simulation 11/100 + [INFO] [eval]... simulation 12/100 + [INFO] [eval]... simulation 13/100 + [INFO] [eval]... simulation 14/100 + [INFO] [eval]... simulation 15/100 + [INFO] [eval]... simulation 16/100 + [INFO] [eval]... simulation 17/100 + [INFO] [eval]... simulation 18/100 + [INFO] [eval]... simulation 19/100 + [INFO] [eval]... simulation 20/100 + [INFO] [eval]... simulation 21/100 + [INFO] [eval]... simulation 22/100 + [INFO] [eval]... simulation 23/100 + [INFO] [eval]... simulation 24/100 + [INFO] [eval]... simulation 25/100 + [INFO] [eval]... simulation 26/100 + [INFO] [eval]... simulation 27/100 + [INFO] [eval]... simulation 28/100 + [INFO] [eval]... simulation 29/100 + [INFO] [eval]... simulation 30/100 + [INFO] [eval]... simulation 31/100 + [INFO] [eval]... simulation 32/100 + [INFO] [eval]... simulation 33/100 + [INFO] [eval]... simulation 34/100 + [INFO] [eval]... simulation 35/100 + [INFO] [eval]... simulation 36/100 + [INFO] [eval]... simulation 37/100 + [INFO] [eval]... simulation 38/100 + [INFO] [eval]... simulation 39/100 + [INFO] [eval]... simulation 40/100 + [INFO] [eval]... simulation 41/100 + [INFO] [eval]... simulation 42/100 + [INFO] [eval]... simulation 43/100 + [INFO] [eval]... simulation 44/100 + [INFO] [eval]... simulation 45/100 + [INFO] [eval]... simulation 46/100 + [INFO] [eval]... simulation 47/100 + [INFO] [eval]... simulation 48/100 + [INFO] [eval]... simulation 49/100 + [INFO] [eval]... simulation 50/100 + [INFO] [eval]... simulation 51/100 + [INFO] [eval]... simulation 52/100 + [INFO] [eval]... simulation 53/100 + [INFO] [eval]... simulation 54/100 + [INFO] [eval]... simulation 55/100 + [INFO] [eval]... simulation 56/100 + [INFO] [eval]... simulation 57/100 + [INFO] [eval]... simulation 58/100 + [INFO] [eval]... simulation 59/100 + [INFO] [eval]... simulation 60/100 + [INFO] [eval]... simulation 61/100 + [INFO] [eval]... simulation 62/100 + [INFO] [eval]... simulation 63/100 + [INFO] [eval]... simulation 64/100 + [INFO] [eval]... simulation 65/100 + [INFO] [eval]... simulation 66/100 + [INFO] [eval]... simulation 67/100 + [INFO] [eval]... simulation 68/100 + [INFO] [eval]... simulation 69/100 + [INFO] [eval]... simulation 70/100 + [INFO] [eval]... simulation 71/100 + [INFO] [eval]... simulation 72/100 + [INFO] [eval]... simulation 73/100 + [INFO] [eval]... simulation 74/100 + [INFO] [eval]... simulation 75/100 + [INFO] [eval]... simulation 76/100 + [INFO] [eval]... simulation 77/100 + [INFO] [eval]... simulation 78/100 + [INFO] [eval]... simulation 79/100 + [INFO] [eval]... simulation 80/100 + [INFO] [eval]... simulation 81/100 + [INFO] [eval]... simulation 82/100 + [INFO] [eval]... simulation 83/100 + [INFO] [eval]... simulation 84/100 + [INFO] [eval]... simulation 85/100 + [INFO] [eval]... simulation 86/100 + [INFO] [eval]... simulation 87/100 + [INFO] [eval]... simulation 88/100 + [INFO] [eval]... simulation 89/100 + [INFO] [eval]... simulation 90/100 + [INFO] [eval]... simulation 91/100 + [INFO] [eval]... simulation 92/100 + [INFO] [eval]... simulation 93/100 + [INFO] [eval]... simulation 94/100 + [INFO] [eval]... simulation 95/100 + [INFO] [eval]... simulation 96/100 + [INFO] [eval]... simulation 97/100 + [INFO] [eval]... simulation 98/100 + [INFO] [eval]... simulation 99/100 + [INFO] [eval]... simulation 100/100 .. code:: ipython3 diff --git a/docs/basics/seeding.rst b/docs/basics/seeding.rst index b03f554b4..f22ded51d 100644 --- a/docs/basics/seeding.rst +++ b/docs/basics/seeding.rst @@ -28,7 +28,8 @@ It works as follows: # to ensure that their random number generators are independent. from rlberry.envs import gym_make from rlberry.agents import RSUCBVIAgent - env = gym_make('MountainCar-v0') + + env = gym_make("MountainCar-v0") env.reseed(seeder) agent = RSUCBVIAgent(env) @@ -55,6 +56,7 @@ It works as follows: # You can also use a seeder to seed external libraries (such as torch) # using the function set_external_seed from rlberry.seeding import set_external_seed + set_external_seed(seeder) diff --git a/docs/other/using_gym.rst b/docs/other/using_gym.rst index b89b4ad6e..85e9741b6 100644 --- a/docs/other/using_gym.rst +++ b/docs/other/using_gym.rst @@ -14,7 +14,7 @@ If you want to use OpenAI Gym environments with rlberry_, simply do the followin from rlberry.envs import gym_make # wraps gym.make # for example, let's take CartPole - env = gym_make('CartPole-v1') + env = gym_make("CartPole-v1") This way, :code:`env` **behaves exactly the same as the gym environment**, we simply replace the seeding function by :meth:`env.reseed`, which ensures unified seeding and reproducibility when using rlberry. diff --git a/docs/other/using_stable_baselines.rst b/docs/other/using_stable_baselines.rst index e19e45ee0..9e48767ed 100644 --- a/docs/other/using_stable_baselines.rst +++ b/docs/other/using_stable_baselines.rst @@ -43,7 +43,7 @@ agent. In order to use it with AgentManagers, it must be included in the implementation of `Stable Baselines`_ and evaluate two hyperparameter configurations. .. code-block:: python - + class A2CAgent(StableBaselinesAgent): """A2C with hyperparameter optimization.""" diff --git a/docs/themes/scikit-learn-fork/static/css/theme.css b/docs/themes/scikit-learn-fork/static/css/theme.css index 2c513a3dc..c1170f1cc 100644 --- a/docs/themes/scikit-learn-fork/static/css/theme.css +++ b/docs/themes/scikit-learn-fork/static/css/theme.css @@ -82,7 +82,7 @@ img { span.highlighted { background-color: #fbe54e; } - + div.highlight { border: 1px solid #ddd; margin-bottom: 1rem; diff --git a/docs/themes/scikit-learn-fork/static/js/vendor/bootstrap.min.js b/docs/themes/scikit-learn-fork/static/js/vendor/bootstrap.min.js index 4955aeec1..2b2432381 100644 --- a/docs/themes/scikit-learn-fork/static/js/vendor/bootstrap.min.js +++ b/docs/themes/scikit-learn-fork/static/js/vendor/bootstrap.min.js @@ -3,4 +3,4 @@ * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right

',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:''}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||tthis._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:''}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t 0, "nrooms must be > 0" assert initial_state_distribution in ("center", "uniform") @@ -263,7 +262,7 @@ def get_background(self): bg = Scene() # traps - for (y, x) in self.traps: + for y, x in self.traps: shape = GeometricPrimitive("POLYGON") shape.set_color((0.5, 0.0, 0.0)) shape.add_vertex((x, y)) @@ -284,7 +283,7 @@ def get_background(self): bg.add_shape(shape) # rewards - for (y, x) in self.reward_at: + for y, x in self.reward_at: flag = GeometricPrimitive("POLYGON") rwd = self.reward_at[(y, x)] if rwd == 1.0: diff --git a/rlberry/envs/benchmarks/grid_exploration/six_room.py b/rlberry/envs/benchmarks/grid_exploration/six_room.py index 095b62ae9..86dc2c900 100644 --- a/rlberry/envs/benchmarks/grid_exploration/six_room.py +++ b/rlberry/envs/benchmarks/grid_exploration/six_room.py @@ -131,7 +131,7 @@ def get_background(self): bg.add_shape(shape) # rewards - for (y, x) in self.reward_at: + for y, x in self.reward_at: flag = GeometricPrimitive("POLYGON") rwd = self.reward_at[(y, x)] if rwd == 10: diff --git a/rlberry/envs/finite/gridworld.py b/rlberry/envs/finite/gridworld.py index dc9a1f1b7..974b5ee00 100644 --- a/rlberry/envs/finite/gridworld.py +++ b/rlberry/envs/finite/gridworld.py @@ -279,7 +279,7 @@ def _build_ascii(self): grid[rr][cc] = "o " grid_idx[rr][cc] = str(self.coord2index[(rr, cc)]).zfill(3) - for (rr, cc) in self.reward_at: + for rr, cc in self.reward_at: rwd = self.reward_at[(rr, cc)] if rwd > 0: grid[rr][cc] = "+ " @@ -452,7 +452,7 @@ def get_background(self): bg.add_shape(shape) # rewards - for (y, x) in self.reward_at: + for y, x in self.reward_at: flag = GeometricPrimitive("POLYGON") rwd = self.reward_at[(y, x)] color = 0.5 * np.abs(rwd) / self.reward_range[1] diff --git a/rlberry/envs/tests/test_spring_env.py b/rlberry/envs/tests/test_spring_env.py index 439194dbd..67ec1907f 100644 --- a/rlberry/envs/tests/test_spring_env.py +++ b/rlberry/envs/tests/test_spring_env.py @@ -16,7 +16,6 @@ def test_spring_cartpole(): - # test 1 - default env = SpringCartPole() @@ -84,6 +83,7 @@ def test_rk4(): """ Test of the rk4 utils defined in speingcartpole """ + ## 2D system def derivs6(x, t): d1 = x[0] + 2 * x[1] diff --git a/rlberry/experiment/generator.py b/rlberry/experiment/generator.py index 2cb487e6a..5adb9ed9d 100644 --- a/rlberry/experiment/generator.py +++ b/rlberry/experiment/generator.py @@ -32,7 +32,7 @@ def experiment_generator(): max_workers = int(args["--max_workers"]) if max_workers == -1: max_workers = None - for (_, agent_manager_kwargs) in parse_experiment_config( + for _, agent_manager_kwargs in parse_experiment_config( Path(args[""]), n_fit=int(args["--n_fit"]), max_workers=max_workers, diff --git a/rlberry/experiment/tests/room.yaml b/rlberry/experiment/tests/room.yaml index 764d81a2c..8667278d5 100644 --- a/rlberry/experiment/tests/room.yaml +++ b/rlberry/experiment/tests/room.yaml @@ -2,4 +2,4 @@ constructor: 'rlberry.envs.benchmarks.grid_exploration.nroom.NRoom' params: reward_free: false array_observation: true - nrooms: 5 \ No newline at end of file + nrooms: 5 diff --git a/rlberry/experiment/tests/rsucbvi.yaml b/rlberry/experiment/tests/rsucbvi.yaml index e9ae75c64..4c9273e1b 100644 --- a/rlberry/experiment/tests/rsucbvi.yaml +++ b/rlberry/experiment/tests/rsucbvi.yaml @@ -10,4 +10,4 @@ init_kwargs: eval_kwargs: eval_horizon: 50 fit_kwargs: - fit_budget: 123 \ No newline at end of file + fit_budget: 123 diff --git a/rlberry/experiment/tests/rsucbvi_alternative.yaml b/rlberry/experiment/tests/rsucbvi_alternative.yaml index cb61fdb84..eb829ec9e 100644 --- a/rlberry/experiment/tests/rsucbvi_alternative.yaml +++ b/rlberry/experiment/tests/rsucbvi_alternative.yaml @@ -2,4 +2,4 @@ base_config: 'rlberry/experiment/tests/rsucbvi.yaml' init_kwargs: gamma: 0.9 eval_kwargs: - horizon: 50 \ No newline at end of file + horizon: 50 diff --git a/rlberry/experiment/yaml_utils.py b/rlberry/experiment/yaml_utils.py index 05d4c61a5..ed8734d41 100644 --- a/rlberry/experiment/yaml_utils.py +++ b/rlberry/experiment/yaml_utils.py @@ -210,5 +210,5 @@ def parse_experiment_config( if __name__ == "__main__": filename = "examples/demo_experiment/params_experiment.yaml" - for (seed, agent_manager) in parse_experiment_config(Path(filename)): + for seed, agent_manager in parse_experiment_config(Path(filename)): print(seed) diff --git a/rlberry/exploration_tools/torch/rnd.py b/rlberry/exploration_tools/torch/rnd.py index 1acf88de7..7a9e4f3b8 100644 --- a/rlberry/exploration_tools/torch/rnd.py +++ b/rlberry/exploration_tools/torch/rnd.py @@ -146,7 +146,6 @@ def _get_embeddings(self, state, action=None, batch=False, all_actions=False): @preprocess_args(expected_type="torch") def update(self, state, action=None, next_state=None, reward=None, **kwargs): - batch = [(state, action)] if self.batch_size > 0 and not self.memory.is_empty(): batch += self.memory.sample(self.batch_size) diff --git a/rlberry/manager/agent_manager.py b/rlberry/manager/agent_manager.py index 72815bbd5..a591e769a 100644 --- a/rlberry/manager/agent_manager.py +++ b/rlberry/manager/agent_manager.py @@ -877,7 +877,6 @@ def load(cls, filename): return obj def __eq__(self, other): - result = True self_init_kwargs = [_strip_seed_dir(kw) for kw in self.init_kwargs] other_init_kwargs = [_strip_seed_dir(kw) for kw in other.init_kwargs] diff --git a/rlberry/manager/evaluation.py b/rlberry/manager/evaluation.py index 7a2d121c9..2fe028b76 100644 --- a/rlberry/manager/evaluation.py +++ b/rlberry/manager/evaluation.py @@ -279,7 +279,6 @@ def read_writer_data(data_source, tag=None, preprocess_func=None, id_agent=None) def _get_last_xp(input_dir, name): - dir_name = Path(input_dir) / "manager_data" # list all of the experiments for this particular agent diff --git a/rlberry/network/tests/test_server.py b/rlberry/network/tests/test_server.py index f06b5ed74..a306633e3 100644 --- a/rlberry/network/tests/test_server.py +++ b/rlberry/network/tests/test_server.py @@ -32,7 +32,6 @@ class Starter(ProcessStarter): def test_client(): - port = 4242 client = BerryClient(port=port) # Send params for AgentManager diff --git a/rlberry/rendering/render_interface.py b/rlberry/rendering/render_interface.py index 0b7621e9e..af846cf33 100644 --- a/rlberry/rendering/render_interface.py +++ b/rlberry/rendering/render_interface.py @@ -140,7 +140,6 @@ def render(self, loop=True, **kwargs): return 1 def get_video(self, framerate=25, **kwargs): - # background and data background, data = self._get_background_and_scenes() diff --git a/rlberry/utils/writers.py b/rlberry/utils/writers.py index 3cf99d3e5..fcdfdac46 100644 --- a/rlberry/utils/writers.py +++ b/rlberry/utils/writers.py @@ -289,7 +289,6 @@ def _log(self): # log if enough time has passed since the last log max_global_step = 0 if time_elapsed > self._log_interval: - self._time_last_log = t_now size_term = shutil.get_terminal_size().columns diff --git a/scripts/conda_env_setup.sh b/scripts/conda_env_setup.sh index 9a194c173..8abd5485f 100644 --- a/scripts/conda_env_setup.sh +++ b/scripts/conda_env_setup.sh @@ -20,4 +20,4 @@ echo "" echo "Contents of $CONDA_PREFIX/etc/conda/deactivate.d/env_vars.sh:" cat ./etc/conda/deactivate.d/env_vars.sh -echo "" \ No newline at end of file +echo "" diff --git a/scripts/construct_video_examples.sh b/scripts/construct_video_examples.sh index e260c111f..4bdc3c291 100755 --- a/scripts/construct_video_examples.sh +++ b/scripts/construct_video_examples.sh @@ -13,7 +13,7 @@ do # construct the mp4 python $f name=$(basename $f) -# make a thumbnail. Warning : the video should have the same name as the python script +# make a thumbnail. Warning : the video should have the same name as the python script # i.e. video_plot_SOMETHING.mp4 to be detected ffmpeg -i ../docs/_video/${name%%.py}.mp4 -vframes 1 -f image2 ../docs/thumbnails/${name%%.py}.jpg done diff --git a/scripts/fetch_contributors.py b/scripts/fetch_contributors.py index 5203eabbc..51afaec98 100644 --- a/scripts/fetch_contributors.py +++ b/scripts/fetch_contributors.py @@ -111,7 +111,6 @@ def generate_list(contributors): if __name__ == "__main__": - members = get_contributors() with open(REPO_FOLDER / "docs" / "contributors.rst", "w+") as rst_file: