-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
taking utility functions out of the actor critic base class
Summary: There were four utility functions in the actor critic base class, `make_critic`, `update_critic_target_network`, `single_critic_state_value_loss` and `twin_critic_action_value_loss` which are also used by the reward constrained safety module in addition to the actor-critic algorithms. This diff moves them to a separate file called 'critic_utils.py' in the utils folder, since they seem to be general utility functions what can be used by different modules in pearl. I added some documentation for the `make_critic` and `update_critic_target_network` function. I also modified the `update_critic_target_network` function to not input `use_twin_critic` as an input argument as we can infer from the type of the `target_network` if `TwinCritic` was used. Reviewed By: rodrigodesalvobraz Differential Revision: D55161398 fbshipit-source-id: a598b24ee1d748195513b29ffe0078790d04b05c
- Loading branch information
1 parent
bca09bd
commit abb6308
Showing
11 changed files
with
233 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.