Skip to content

Commit

Permalink
remove parametrization for lipschitz param when coef_lip==1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Mamalet committed Apr 15, 2024
1 parent 87f78e9 commit b8a0b3d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deel/torchlip/modules/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def __init__(self, coefficient_lip: float = 1.0):

def apply_lipschitz_factor(self):
"""Multiply the layer weights by a lipschitz factor."""
if self._coefficient_lip == 1.0:
return
parametrize.register_parametrization(
self, "weight", _LipschitzCoefMultiplication(self._coefficient_lip)
)
Expand Down

0 comments on commit b8a0b3d

Please sign in to comment.