diff --git a/docs/sphinx_doc/source/tutorial/trinity_programming_guide.md b/docs/sphinx_doc/source/tutorial/trinity_programming_guide.md index 2e4daeab0b..7119b1af35 100644 --- a/docs/sphinx_doc/source/tutorial/trinity_programming_guide.md +++ b/docs/sphinx_doc/source/tutorial/trinity_programming_guide.md @@ -299,7 +299,7 @@ pip install -e .[dev] # pip install -e .\[dev\] # Run code style checks -pre-commit --all-files +pre-commit run --all-files # Commit the code after all checks pass git commit -am "create example workflow" diff --git a/trinity/algorithm/entropy_loss_fn/entropy_loss_fn.py b/trinity/algorithm/entropy_loss_fn/entropy_loss_fn.py index cf102dd6b7..e575caa449 100644 --- a/trinity/algorithm/entropy_loss_fn/entropy_loss_fn.py +++ b/trinity/algorithm/entropy_loss_fn/entropy_loss_fn.py @@ -32,12 +32,12 @@ def __call__( """ @classmethod - @abstractmethod def default_args(cls) -> Dict: """ Returns: `Dict`: The default arguments for the entropy loss function. """ + return {"entropy_coef": 0.0} @ENTROPY_LOSS_FN.register_module("basic") @@ -58,10 +58,6 @@ def __call__( entropy_loss = masked_mean(entropy, action_mask) return entropy_loss * self.entropy_coef, {"entropy_loss": entropy_loss.detach().item()} - @classmethod - def default_args(cls) -> Dict: - return {"entropy_coef": 0.0} - @ENTROPY_LOSS_FN.register_module("none") class DummyEntropyLossFn(EntropyLossFn): @@ -79,7 +75,3 @@ def __call__( **kwargs, ) -> Tuple[torch.Tensor, Dict]: return torch.tensor(0.0), {} - - @classmethod - def default_args(cls) -> Dict: - return {}