Safemotion Lib
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
fastreid.modeling.backbones.osnet.ConvLayer Class Reference

Basic layers. More...

Inheritance diagram for fastreid.modeling.backbones.osnet.ConvLayer:

Public Member Functions

 __init__ (self, in_channels, out_channels, kernel_size, bn_norm, stride=1, padding=0, groups=1, IN=False)
 
 forward (self, x)
 

Public Attributes

 conv
 
 bn
 
 relu
 

Detailed Description

Basic layers.

Convolution layer (conv + bn + relu).

Definition at line 37 of file osnet.py.

Constructor & Destructor Documentation

◆ __init__()

fastreid.modeling.backbones.osnet.ConvLayer.__init__ ( self,
in_channels,
out_channels,
kernel_size,
bn_norm,
stride = 1,
padding = 0,
groups = 1,
IN = False )

Definition at line 40 of file osnet.py.

50 ):
51 super(ConvLayer, self).__init__()
52 self.conv = nn.Conv2d(
53 in_channels,
54 out_channels,
55 kernel_size,
56 stride=stride,
57 padding=padding,
58 bias=False,
59 groups=groups
60 )
61 if IN:
62 self.bn = nn.InstanceNorm2d(out_channels, affine=True)
63 else:
64 self.bn = get_norm(bn_norm, out_channels)
65 self.relu = nn.ReLU(inplace=True)
66

Member Function Documentation

◆ forward()

fastreid.modeling.backbones.osnet.ConvLayer.forward ( self,
x )

Definition at line 67 of file osnet.py.

67 def forward(self, x):
68 x = self.conv(x)
69 x = self.bn(x)
70 x = self.relu(x)
71 return x
72
73

Member Data Documentation

◆ bn

fastreid.modeling.backbones.osnet.ConvLayer.bn

Definition at line 62 of file osnet.py.

◆ conv

fastreid.modeling.backbones.osnet.ConvLayer.conv

Definition at line 52 of file osnet.py.

◆ relu

fastreid.modeling.backbones.osnet.ConvLayer.relu

Definition at line 65 of file osnet.py.


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