first push

This commit is contained in:
2022-11-22 15:32:06 +08:00
commit f4eee81c45
81 changed files with 31537 additions and 0 deletions

View File

@ -0,0 +1,33 @@
import torch
import torch.nn as nn
import cirtorch.layers.functional as LF
# --------------------------------------
# Normalization layers
# --------------------------------------
class L2N(nn.Module):
def __init__(self, eps=1e-6):
super(L2N,self).__init__()
self.eps = eps
def forward(self, x):
return LF.l2n(x, eps=self.eps)
def __repr__(self):
return self.__class__.__name__ + '(' + 'eps=' + str(self.eps) + ')'
class PowerLaw(nn.Module):
def __init__(self, eps=1e-6):
super(PowerLaw, self).__init__()
self.eps = eps
def forward(self, x):
return LF.powerlaw(x, eps=self.eps)
def __repr__(self):
return self.__class__.__name__ + '(' + 'eps=' + str(self.eps) + ')'