Safemotion Lib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
fastreid.layers.batch_norm.IBN Class Reference
Inheritance diagram for fastreid.layers.batch_norm.IBN:

Public Member Functions

 __init__ (self, planes, bn_norm, **kwargs)
 
 forward (self, x)
 

Public Attributes

 half
 
 IN
 
 BN
 

Detailed Description

Definition at line 43 of file batch_norm.py.

Constructor & Destructor Documentation

◆ __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

Member Function Documentation

◆ 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

Member Data Documentation

◆ BN

fastreid.layers.batch_norm.IBN.BN

Definition at line 50 of file batch_norm.py.

◆ half

fastreid.layers.batch_norm.IBN.half

Definition at line 47 of file batch_norm.py.

◆ IN

fastreid.layers.batch_norm.IBN.IN

Definition at line 49 of file batch_norm.py.


The documentation for this class was generated from the following file: