Skip to content

Commit

Permalink
Amend
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobettini committed Nov 23, 2023
1 parent 9d759f1 commit 3b0811b
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 7 deletions.
10 changes: 9 additions & 1 deletion benchmarl/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
# LICENSE file in the root directory of this source tree.
#

from .mlp import MlpConfig
from .common import Model, ModelConfig, SequenceModel, SequenceModelConfig
from .mlp import Mlp, MlpConfig

common = ["Model", "ModelConfig", "SequenceModel", "SequenceModelConfig"]
classes = [
"Mlp",
"MlpConfig",
]
__all__ = common + classes

model_config_registry = {"mlp": MlpConfig}
6 changes: 4 additions & 2 deletions benchmarl/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ class ModelConfig(ABC):
Dataclass representing an model configuration.
This should be overridden by implemented models.
Implementors should:
1. add configuration parameters for their algorithm
2. implement all abstract methods
1. add configuration parameters for their algorithm
2. implement all abstract methods
"""

def get_model(
Expand Down
24 changes: 24 additions & 0 deletions docs/source/concepts/components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,27 @@ determine the training strategy. Here is a table with the currently implemented
+---------------------------------------+---------------+--------------+------------------------------+-----------------------+---------------------+--+
| :class:`~benchmarl.algorithms.Iql` | Off | No | NA | Discrete | No | |
+---------------------------------------+---------------+--------------+------------------------------+-----------------------+---------------------+--+

.. _environment-table:

.. table:: Environments in BenchMARL

+-------------------------------------------------+-------+---------------------------+--------------+-------------------------------+-----------------------+------------+
| Environment | Tasks | Cooperation | Global state | Reward function | Action space | Vectorized |
+=================================================+=======+===========================+==============+===============================+=======================+============+
| :class:`~benchmarl.environments.VmasTask` | 5 | Cooperative + Competitive | No | Shared + Independent + Global | Continuous + Discrete | Yes |
+-------------------------------------------------+-------+---------------------------+--------------+-------------------------------+-----------------------+------------+
| :class:`~benchmarl.environments.Smacv2Task` | 15 | Cooperative | Yes | Global | Discrete | No |
+-------------------------------------------------+-------+---------------------------+--------------+-------------------------------+-----------------------+------------+
| :class:`~benchmarl.environments.PettingZooTask` | 10 | Cooperative + Competitive | Yes + No | Shared + Independent | Continuous + Discrete | No |
+-------------------------------------------------+-------+---------------------------+--------------+-------------------------------+-----------------------+------------+

.. _model-table:

.. table:: Models in BenchMARL

+---------------------------------+---------------+-------------------------------+-------------------------------+
| Name | Decentralized | Centralized with local inputs | Centralized with global input |
+=================================+===============+===============================+===============================+
| :class:`~benchmarl.models.Mlp` | Yes | Yes | Yes |
+---------------------------------+---------------+-------------------------------+-------------------------------+
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ the domain and want to easily take a picture of the landscape.
modules/experiment
modules/algorithms
modules/environments
modules/models
5 changes: 2 additions & 3 deletions docs/source/modules/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ Common
:toctree: ../generated
:template: autosummary/class.rst

{% for name in benchmarl.algorithms.common %}
{{ name }}
{% endfor %}
Algorithm
AlgorithmConfig

Algorithms
----------
Expand Down
13 changes: 12 additions & 1 deletion docs/source/modules/experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,26 @@ benchmarl.experiment

.. currentmodule:: benchmarl.experiment


.. contents:: Contents
:local:

Experiment
----------

.. autosummary::
:nosignatures:
:toctree: ../generated
:template: autosummary/class.rst

Experiment
ExperimentConfig

Callback
--------

.. autosummary::
:nosignatures:
:toctree: ../generated
:template: autosummary/class.rst

Callback
35 changes: 35 additions & 0 deletions docs/source/modules/models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

benchmarl.models
================

.. currentmodule:: benchmarl.models

.. contents:: Contents
:local:

Here you can find the :ref:`model table <model-table>`.

Common
------

.. autosummary::
:nosignatures:
:toctree: ../generated
:template: autosummary/class.rst

Model
ModelConfig
SequenceModel
SequenceModelConfig

Models
------

.. autosummary::
:nosignatures:
:toctree: ../generated
:template: autosummary/class.rst

{% for name in benchmarl.models.classes %}
{{ name }}
{% endfor %}

0 comments on commit 3b0811b

Please sign in to comment.