-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core/Rules: ParamMod and Generalized Gamma Rule
- change the gamma rule to its generalized version - since the generalized gamma version needs the unmodified output of the function (and therefore ignore zero_params), we need a way to specify the zero_params on a per-modifier basis - this was solved by implementing the previous mod_params function as a class ParamMod, which takes the same arguments, except the module, in its __init__ - param_modifiers can now be specified as instances of ParamMod, where `zero_params` etc. may be supplied - this also makes passing mod_params-keyword-arguments to BasicHook obsolete, as these are now stored in the param_modifiers themselves - passing simple functions (or callables) in param_modifiers is still okay, the function will then be used to instantiate a ParamMod object with the default parameters - all param_modifiers in zennit.rules are now replaced with ParamMod instances, and ParamMod subclasses are implemented for the common ClampMod, GammaMod and NoMod - tests now do not need to check for the param_keys in BasicHook anymore, as this is done by comparing the ParamMod instances - updated and extended the gamma rule docstring - added zero_params to docstrings in composites and rules - updated docstrings for BasicHook - added and modified tests for ParamMod - added paragraph and code on ParamMod in how-to/write-custom-rules - update ResNet50 heatmaps in README.md
- Loading branch information
Showing
9 changed files
with
390 additions
and
138 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
Binary file not shown.
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.