Skip to content

Commit

Permalink
Merge pull request #65 from zuoxingdong/refactor_envs
Browse files Browse the repository at this point in the history
Breaking refactorings

Former-commit-id: cba2938225bbe232dc90bd784b32ffe0ba1ae874 [formerly 0d78cd0a9611aeb17a332bab98a35207c9e4c32f]
Former-commit-id: 602dc5398400c29e8453e5d77d8dd58f3ccf7960
  • Loading branch information
zuoxingdong authored Mar 4, 2019
2 parents 65267e6 + 003fd72 commit 496e296
Show file tree
Hide file tree
Showing 123 changed files with 3,420 additions and 7,887 deletions.
107 changes: 25 additions & 82 deletions docs/source/envs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,127 +4,70 @@ lagom.envs
.. automodule:: lagom.envs
.. currentmodule:: lagom.envs

Spaces
----------------
.. autofunction:: flatdim

.. currentmodule:: lagom.envs.spaces
.. autofunction:: flatten

.. autoclass:: Space
:members:

.. autoclass:: Discrete
:members:

.. autoclass:: Box
:members:

.. autoclass:: Tuple
.. autofunction:: unflatten

.. autoclass:: VecEnv
:members:

.. autoclass:: Dict
.. autoclass:: VecEnvWrapper
:members:

.. autofunction:: convert_gym_space

Environment
---------------

.. currentmodule:: lagom.envs

.. autoclass:: Env
.. autoclass:: SerialVecEnv
:members:

.. autoclass:: EnvSpec
.. autoclass:: ParallelVecEnv
:members:

.. autoclass:: GoalEnv
.. autoclass:: AtariPreprocessing
:members:

.. autofunction:: make_gym_env

.. autofunction:: make_envs
.. autofunction:: wrap_atari

.. autofunction:: make_vec_env

.. autoclass:: AtariPreprocessing
:members:

.. autofunction:: make_atari_env

Wrappers
--------------

.. currentmodule:: lagom.envs.wrappers

.. autoclass:: Wrapper
:members:

.. autoclass:: ObservationWrapper
.. autofunction:: get_wrapper

.. autoclass:: ClipAction
:members:
.. autoclass:: ActionWrapper

.. autoclass:: ClipReward
:members:

.. autoclass:: RewardWrapper
.. autoclass:: FlattenObservation
:members:

.. autoclass:: GymWrapper
.. autoclass:: FrameStack
:members:

.. autoclass:: ClipReward
.. autoclass:: GrayScaleObservation
:members:

.. autoclass:: FlattenObservation
.. autoclass:: ResizeObservation
:members:

.. autoclass:: FlattenDictWrapper
:members:

.. autoclass:: FrameStack
:members:

.. autoclass:: RewardScale
:members:

.. autoclass:: ScaleImageObservation
:members:

.. autoclass:: TimeAwareObservation
:members:

.. autoclass:: GrayScaleObservation
:members:

.. autoclass:: ResizeObservation
:members:

Vectorized Environment
--------------------------

.. currentmodule:: lagom.envs.vec_env

.. autoclass:: VecEnv
:members:

.. autoclass:: SerialVecEnv
:members:

.. autoclass:: ParallelVecEnv
:members:

.. autoclass:: VecEnvWrapper
:members:

.. autoclass:: VecStandardize
:members:

.. autoclass:: VecClipAction
:members:

.. autoclass:: VecMonitor
:members:
.. autoclass:: CloudpickleWrapper

.. autoclass:: VecStandardizeObservation
:members:

.. autofunction:: get_wrapper
.. autoclass:: VecStandardizeReward
:members:
47 changes: 0 additions & 47 deletions docs/source/history.rst

This file was deleted.

4 changes: 1 addition & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ A graphical illustration is coming soon.
lagom.envs <envs>
lagom.es <es>
lagom.experiment <experiment>
lagom.history <history>
lagom.metric <metric>
lagom.memory <memory>
lagom.multiprocessing <multiprocessing>
lagom.networks <networks>
lagom.policies <policies>
lagom.runner <runner>
lagom.transform <transform>
lagom.value_functions <value_functions>
lagom.vis <vis>
lagom.utils <utils>

Expand Down
25 changes: 25 additions & 0 deletions docs/source/metric.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
lagom.metric: Metrics
===================================

.. automodule:: lagom.metric
.. currentmodule:: lagom.metric

.. autofunction:: returns

.. autofunction:: get_returns

.. autofunction:: bootstrapped_returns

.. autofunction:: get_bootstrapped_returns

.. autofunction:: td0_target

.. autofunction:: get_td0_target

.. autofunction:: td0_error

.. autofunction:: get_td0_error

.. autofunction:: gae

.. autofunction:: get_gae
3 changes: 3 additions & 0 deletions docs/source/runner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ lagom.runner: Runner
.. automodule:: lagom.runner
.. currentmodule:: lagom.runner

.. autoclass:: BatchHistory
:members:

.. autoclass:: BaseRunner
:members:

Expand Down
32 changes: 12 additions & 20 deletions docs/source/transform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,21 @@ lagom.transform: Transformations
.. automodule:: lagom.transform
.. currentmodule:: lagom.transform

.. autoclass:: BaseTransform
:members:
.. autofunction:: interp_curves

.. autoclass:: RankTransform
:members:

.. autoclass:: ExpFactorCumSum
:members:

.. autoclass:: ExplainedVariance
:members:
.. autofunction:: geometric_cumsum

.. autoclass:: RunningMeanStd
.. autofunction:: explained_variance

.. autoclass:: LinearSchedule
:members:


.. autofunction:: rank_transform

.. autoclass:: RunningAverage
:members:

.. autoclass:: InterpCurve
:members:

.. autoclass:: SmoothFilter
:members:

.. autoclass:: LinearSchedule

.. autoclass:: RunningMeanStd
:members:

.. autofunction:: smooth_filter
3 changes: 3 additions & 0 deletions docs/source/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ lagom.utils: Utils
.. autofunction:: timed

.. autofunction:: ask_yes_or_no

.. autoclass:: CloudpickleWrapper
:members:
10 changes: 5 additions & 5 deletions docs/source/vis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ lagom.vis: Visualization

.. automodule:: lagom.vis
.. currentmodule:: lagom.vis

.. autoclass:: BasePlot
:members:

.. autoclass:: CurvePlot
:members:
.. autofunction:: lineplot

.. autofunction:: auto_ax

.. autofunction:: tick_formatter

.. autoclass:: GridImage
:members:
Expand Down
191 changes: 191 additions & 0 deletions examples/es.ipynb

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions examples/es/__init__.py

This file was deleted.

52 changes: 0 additions & 52 deletions examples/es/cma_es.py

This file was deleted.

Loading

0 comments on commit 496e296

Please sign in to comment.