Skip to content

Commit

Permalink
docs: add new contents
Browse files Browse the repository at this point in the history
  • Loading branch information
BillHuang2001 committed Aug 3, 2023
1 parent ce2904f commit feb5081
Show file tree
Hide file tree
Showing 19 changed files with 150 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/source/api/algorithms/mo/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Multi-objective
ibea
moead
nsga2
nsga3
rvea
7 changes: 7 additions & 0 deletions docs/source/api/algorithms/mo/nsga3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
========
NSGA-III
========

.. autoclass:: evox.algorithms.NSGA3
:members:
:inherited-members:
7 changes: 7 additions & 0 deletions docs/source/api/monitors/evoxvis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
===============
EvoXVis Monitor
===============

.. autoclass:: evox.monitors.EvoXVisMonitor
:members:
:inherited-members:
10 changes: 10 additions & 0 deletions docs/source/api/monitors/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
========
Monitors
========

.. toctree::
:maxdepth: 1

std_so
std_mo
evoxvis
7 changes: 7 additions & 0 deletions docs/source/api/monitors/std_mo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
================================
Standard Multi-objective Monitor
================================

.. autoclass:: evox.monitors.StdMOMonitor
:members:
:inherited-members:
7 changes: 7 additions & 0 deletions docs/source/api/monitors/std_so.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
=================================
Standard Single-objective Monitor
=================================

.. autoclass:: evox.monitors.StdSOMonitor
:members:
:inherited-members:
8 changes: 4 additions & 4 deletions docs/source/api/pipelines/distributed.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
====================
Distributed Pipeline
====================
==============================
Ray-based Distributed Workflow
==============================

.. autoclass:: evox.pipelines.DistributedPipeline
.. autoclass:: evox.pipelines.RayDistributedWorkflow
:members:
:inherited-members:
3 changes: 2 additions & 1 deletion docs/source/api/pipelines/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Pipelines
:maxdepth: 1

standard
distributed
distributed
uni
7 changes: 7 additions & 0 deletions docs/source/api/pipelines/uni.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
==================
Universal Workflow
==================

.. autoclass:: evox.pipelines.UniWorkflow
:members:
:inherited-members:
43 changes: 43 additions & 0 deletions docs/source/api/problems/classic/dtlz.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
===========
DTLZ Family
===========

.. autoclass:: evox.problems.classic.DTLZ
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ1
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ2
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ3
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ4
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ5
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ6
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ7
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ8
:members:
:inherited-members:

.. autoclass:: evox.problems.classic.DTLZ9
:members:
:inherited-members:
7 changes: 7 additions & 0 deletions docs/source/api/problems/classic/griewank.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
========
Griewank
========

.. autoclass:: evox.problems.classic.Griewank
:members:
:inherited-members:
4 changes: 4 additions & 0 deletions docs/source/api/problems/classic/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ Numerical Benchmarks
:maxdepth: 1

ackley
dtlz
griewank
rastrigin
rosenbrock
sphere
zdt
7 changes: 7 additions & 0 deletions docs/source/api/problems/classic/rastrigin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
=========
Rastrigin
=========

.. autoclass:: evox.problems.classic.Rastrigin
:members:
:inherited-members:
7 changes: 7 additions & 0 deletions docs/source/api/problems/classic/rosenbrock.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
==========
Rosenbrock
==========

.. autoclass:: evox.problems.classic.Rosenbrock
:members:
:inherited-members:
7 changes: 7 additions & 0 deletions docs/source/api/problems/rl/brax.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
==================
Brax-based Problem
==================

.. autoclass:: evox.problems.rl.Brax
:members:
:inherited-members:
3 changes: 2 additions & 1 deletion docs/source/api/problems/rl/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ RL
.. toctree::
:maxdepth: 1

gym
brax
gym
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

# mock these modules, so we can build the document without these dependencies.
autodoc_mock_imports = [
"brax",
"chex",
"gym",
"ray",
Expand Down
3 changes: 2 additions & 1 deletion src/evox/monitors/std_mo_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class StdMOMonitor:
"""Standard multi-objective monitor
Used for multi-objective workflow,
can monitor fitness and record the pareto front.
Parameters
----------
record_pf
Expand Down Expand Up @@ -74,4 +75,4 @@ def flush(self):
hcb.barrier_wait()

def close(self):
self.flush()
self.flush()
18 changes: 18 additions & 0 deletions src/evox/problems/rl/brax.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ def __init__(
cap_episode: int,
fitness_is_neg_reward: bool = True,
):
"""Contruct a brax-based problem
Parameters
----------
policy
A function that accept two arguments
the first one is the parameter and the second is the input.
env_name
The environment name.
batch_size
The number of brax environments to run in parallel.
Usually this should match the population size at the algorithm side.
cap_episode
The maximum number episodes to run.
fitness_is_neg_reward
Whether to return the fitness value as the negative of reward or not.
Default to True.
"""
self.batched_policy = jit(vmap(policy))
self.env = envs.wrappers.VmapWrapper(envs.create(env_name=env_name))
self.batch_size = batch_size
Expand Down

0 comments on commit feb5081

Please sign in to comment.