Skip to content

Commit

Permalink
Add NeurIPS 2022 Discrete Soft Actor Critic agent to agent zoo (#1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adaickalavan authored Feb 13, 2023
1 parent a81c3ce commit 6238846
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Copy and pasting the git commit messages is __NOT__ enough.
## [Unreleased]
### Added
- Added a zoo agent, named Control-and-Supervised-Learning, from NeurIPS 2022 submission. This zoo agent runs in benchmark `driving_smarts==0.0`.
- Added a zoo agent, named Discrete Soft Actor Critic, from NeurIPS 2022 submission. This zoo agent runs in benchmark `driving_smarts==0.0`.
### Changed
### Deprecated
### Fixed
Expand Down
6 changes: 6 additions & 0 deletions docs/benchmarks/agent_zoo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ Available zoo agents
- :attr:`~smarts.core.controllers.ActionSpaceType.TargetPose`
- `code <https://github.com/smarts-project/smarts-project.rl/tree/master/control_and_supervised_learning>`__
- Contributed as part of `NeurIPS 2022 Driving SMARTS <https://smarts-project.github.io/archive/2022_nips_driving_smarts/>`__ competition.
* - | zoo.policies:discrete-soft-actor-critic-agent-v0
| zoo/policies/discrete_soft_actor_critic
- driving_smarts==0.0
- :attr:`~smarts.core.controllers.ActionSpaceType.TargetPose`
- `code <https://github.com/smarts-project/smarts-project.rl/tree/master/discrete_soft_actor_critic>`__
- Contributed as part of `NeurIPS 2022 Driving SMARTS <https://smarts-project.github.io/archive/2022_nips_driving_smarts/>`__ competition.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"sphinx.ext.coverage", # to generate documentation coverage reports
"sphinx.ext.extlinks", # shorten external links
"sphinx.ext.napoleon", # support Numpy and Google doc style
"sphinx.ext.todo", # support for todo items
"sphinx.ext.todo", # support for todo items
"sphinx.ext.viewcode", # link to sourcecode from docs
"sphinx_rtd_theme", # Read The Docs theme
"sphinx_click", # extract documentation from a `click` application
Expand Down
23 changes: 21 additions & 2 deletions zoo/policies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def entry_point_iamp(**kwargs):
locator="interaction-aware-motion-prediction-agent-v0", entry_point=entry_point_iamp
)


def entry_point_casl(**kwargs):
pkg = "control_and_supervised_learning"
module = ".policy"
Expand All @@ -146,6 +147,24 @@ def entry_point_casl(**kwargs):
agent_builder=lib.Policy,
)


register(
locator="control-and-supervised-learning-agent-v0", entry_point=entry_point_casl,
)
locator="control-and-supervised-learning-agent-v0",
entry_point=entry_point_casl,
)


def entry_point_dsac(**kwargs):
pkg = "discrete_soft_actor_critic"
module = ".policy"
lib = _verify_installation(pkg=pkg, module=module)

return AgentSpec(
interface=AgentInterface(
action=ActionSpaceType.TargetPose,
),
agent_builder=lib.Policy,
)


register(locator="discrete-soft-actor-critic-agent-v0", entry_point=entry_point_dsac)
19 changes: 19 additions & 0 deletions zoo/policies/discrete_soft_actor_critic/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[metadata]
name = smarts_agent_dsac_stub
version = 0.1.0
url = https://github.com/huawei-noah/SMARTS
description = SMARTS zoo agent.
long_description = Trained Discrete Soft Actor Critic agent. See [SMARTS](https://github.com/huawei-noah/SMARTS).
long_description_content_type=text/markdown
classifiers=
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8

[options]
packages = find:
include_package_data = True
zip_safe = True
python_requires = == 3.8.*
install_requires =
smarts_agent_dsac==0.1.0
4 changes: 4 additions & 0 deletions zoo/policies/discrete_soft_actor_critic/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from setuptools import setup

if __name__ == "__main__":
setup()

0 comments on commit 6238846

Please sign in to comment.