Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/New acme adders and tests. #276

Merged
merged 16 commits into from
Jul 22, 2021
Merged

Conversation

KaleabTessera
Copy link
Contributor

What?

  • Upgraded acme adders and wrote tests.
  • Enforced docstring styles.
  • Wrote tests for all systems.

Why?

  • To use new version of acme.

How?

  • Updated adders.

Extra

  • V2 of this PR 😆

Copy link
Contributor

@DriesSmit DriesSmit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @KaleabTessera 😄 Thanks for the massive effort 🔥 Did you spot-check that the different properties like recurrent, state-based, centralised still work? I think I checked most of them though. So they should probably still work.

mava/adders/reverb/episode.py Show resolved Hide resolved
mava/systems/tf/maddpg/system.py Show resolved Hide resolved
mava/systems/tf/madqn/networks.py Show resolved Hide resolved
@KaleabTessera
Copy link
Contributor Author

Thanks @DriesSmit !

I wrote tests for feedforward and recurrent systems, so they should work/run. I will quickly add smoke tests for state based, centralized and networked archs.

Copy link
Collaborator

@arnupretorius arnupretorius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thanks @KaleabTessera!! 🔥 Huge effort! 💪

Please just see my few comments. All minor.

mava/adders/base.py Outdated Show resolved Hide resolved
mava/adders/reverb/base.py Outdated Show resolved Hide resolved
mava/adders/reverb/base.py Show resolved Hide resolved
mava/adders/reverb/episode.py Show resolved Hide resolved
mava/adders/reverb/sequence.py Show resolved Hide resolved
mava/adders/reverb/sequence.py Show resolved Hide resolved
@@ -83,7 +83,9 @@ def __init__(
client: reverb.Client,
n_step: int,
discount: float,
*,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I saw online: "The * indicates the end of the positional arguments. Every argument after that can only be specified by keyword." Just wondering why we are being explicit about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding of *, is that it is useful when they are multiple arguments and you want to split "common" arguments from "less common" arguments.

The arguments before *, can be provided positionally and that usually makes sense for parms that are common to a function call. The params after *, , are less common and would be difficult to keep track of their positional spot since there are a lot of them and so are keyword args.

mava/adders/reverb/transition.py Outdated Show resolved Hide resolved
@@ -469,15 +482,15 @@ def __init__(
)

# Forward pass that calculates loss.
def _forward(self, inputs: Any) -> None:
def _forward(self, inputs: reverb.ReplaySample) -> None:
"""Trainer forward pass

Args:
inputs (Any): input data from the data table (transitions)
"""

# TODO: Update this forward function to work like MAD4PG
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep this TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, @DriesSmit do we still need this?

try:
import pyspiel # type: ignore
from open_spiel.python import rl_environment # type: ignore
except ModuleNotFoundError:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, not sure if this is the reason, but we should perhaps consider this for other environments as well for when they haven't been installed as dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick pass and did this for the other environments.

Copy link
Collaborator

@arnupretorius arnupretorius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KaleabTessera! 🥇

@arnupretorius arnupretorius merged commit 7350cca into develop Jul 22, 2021
@arnupretorius arnupretorius deleted the feature/updat-adders-v2 branch July 22, 2021 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants