Skip to content

Commit

Permalink
Merge pull request #63 from deel-ai/feat/lorth_regul_comments
Browse files Browse the repository at this point in the history
Add comments on reference papers
  • Loading branch information
cofri authored Jan 2, 2023
2 parents 7f7d764 + c87fe44 commit d7a4b39
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deel/lip/regularizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def __init__(self, dim, kernel_shape=None, stride=1, conv_transpose=False) -> No
"""
Base class for Lorth regularization. Not meant to be used standalone.
Ref. Achour & al., Existence, Stability And Scalability Of Orthogonal
Convolutional Neural Networks (2022).
https://www.jmlr.org/papers/v23/22-0026.html
Args:
dim (int): the rank of the convolution, e.g. "2" for 2D convolution.
kernel_shape: the shape of the kernel.
Expand Down Expand Up @@ -80,6 +84,7 @@ def _alphaNormSpectral(self):
return alpha

def _check_if_orthconv_exists(self):
"""check the existence of Orthogonal convolution (for circular padding)"""
R, C, M = self._get_kernel_shape()
msg = "Impossible {} configuration for orthogonal convolution."
if C * self.stride**self.dim >= M: # RO case
Expand Down Expand Up @@ -128,6 +133,9 @@ def __init__(self, kernel_shape=None, stride=1, conv_transpose=False) -> None:
Lorth computation for 2D convolutions. Although this class allows to compute
the regularization term, it cannot be used as it is in a layer.
Ref. Wang & al., Orthogonal Convolutional Neural Networks (2020).
http://arxiv.org/abs/1911.12207
Args:
kernel_shape: the shape of the kernel.
stride (int): stride used in the associated convolution
Expand Down

0 comments on commit d7a4b39

Please sign in to comment.