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

[MRG] Allows to build NNs in A2C from a string equal to the function's name #180

Merged
merged 14 commits into from
May 6, 2022

Conversation

riccardodv
Copy link
Collaborator

Allows to build value_net_fn and policy_net_fn from a string using rlberry.utils.factory.load. This is useful when you want to
call model_factory_from_env to build the architectures from a .yaml file according to args specified therein

@riccardodv riccardodv requested review from omardrwch, AleShi94, TimotheeMathieu and mmcenta and removed request for omardrwch May 5, 2022 16:11
@riccardodv
Copy link
Collaborator Author

I think I got some warning but I am not sure if I should worry. It says stuff like "Added line #L117 was not covered by tests". Do you know why?

@TimotheeMathieu
Copy link
Collaborator

It is not a big problem it is just that in the test for A2C, policy_net_fn was always the default I guess so it does not test policy_net_fn which is string or callable.
It would be nice to include a small test on this, maybe doing one iteration on some environment to check that there is no Runtime error. You could do this with @pytest.mark.parametrize for instance, it is clean (example of use in

@pytest.mark.parametrize("agent", FINITE_MDP_AGENTS)
).

@riccardodv
Copy link
Collaborator Author

riccardodv commented May 6, 2022

@TimotheeMathieu I added some checks and is fine now. Thank you!

@riccardodv riccardodv merged commit 32406f0 into rlberry-py:main May 6, 2022
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.

2 participants