MCPcopy Create free account
hub / github.com/XLearning-SCU/2022-CVPR-DART / Normalize

Class Normalize

model.py:6–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4from resnet import resnet50, resnet18
5
6class Normalize(nn.Module):
7 def __init__(self, power=2):
8 super(Normalize, self).__init__()
9 self.power = power
10
11 def forward(self, x):
12 norm = x.pow(self.power).sum(1, keepdim=True).pow(1. / self.power)
13 out = x.div(norm)
14 return out
15
16class Non_local(nn.Module):
17 def __init__(self, in_channels, reduc_ratio=2):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected