Definition at line 43 of file batch_norm.py.
◆ __init__()
| fastreid.layers.batch_norm.IBN.__init__ |
( |
| self, |
|
|
| planes, |
|
|
| bn_norm, |
|
|
** | kwargs ) |
Definition at line 44 of file batch_norm.py.
44 def __init__(self, planes, bn_norm, **kwargs):
45 super(IBN, self).__init__()
46 half1 = int(planes / 2)
47 self.half = half1
48 half2 = planes - half1
49 self.IN = nn.InstanceNorm2d(half1, affine=True)
50 self.BN = get_norm(bn_norm, half2, **kwargs)
51
◆ forward()
| fastreid.layers.batch_norm.IBN.forward |
( |
| self, |
|
|
| x ) |
Definition at line 52 of file batch_norm.py.
52 def forward(self, x):
53 split = torch.split(x, self.half, 1)
54 out1 = self.IN(split[0].contiguous())
55 out2 = self.BN(split[1].contiguous())
56 out = torch.cat((out1, out2), 1)
57 return out
58
59
◆ BN
| fastreid.layers.batch_norm.IBN.BN |
◆ half
| fastreid.layers.batch_norm.IBN.half |
◆ IN
| fastreid.layers.batch_norm.IBN.IN |
The documentation for this class was generated from the following file: