MCPcopy Create free account
hub / github.com/InternRobotics/P3Former / AsymmResBlock

Class AsymmResBlock

p3former/backbones/cylinder3d.py:21–103  ·  view source on GitHub ↗

Asymmetrical Residual Block. Args: in_channels (int): Input channels of the block. out_channels (int): Output channels of the block. norm_cfg (:obj:`ConfigDict` or dict): Config dict for normalization layer. act_cfg (:obj:`ConfigDict` or dict): Config

Source from the content-addressed store, hash-verified

19
20
21class AsymmResBlock(BaseModule):
22 """Asymmetrical Residual Block.
23
24 Args:
25 in_channels (int): Input channels of the block.
26 out_channels (int): Output channels of the block.
27 norm_cfg (:obj:`ConfigDict` or dict): Config dict for
28 normalization layer.
29 act_cfg (:obj:`ConfigDict` or dict): Config dict of activation layers.
30 Defaults to dict(type='LeakyReLU').
31 indice_key (str, optional): Name of indice tables. Defaults to None.
32 """
33
34 def __init__(self,
35 in_channels: int,
36 out_channels: int,
37 norm_cfg: ConfigType,
38 act_cfg: ConfigType = dict(type='LeakyReLU'),
39 indice_key: Optional[str] = None):
40 super().__init__()
41
42 self.conv0_0 = SubMConv3d(
43 in_channels,
44 out_channels,
45 kernel_size=(1, 3, 3),
46 padding=1,
47 bias=False,
48 indice_key=indice_key + 'bef')
49 self.act0_0 = build_activation_layer(act_cfg)
50 self.bn0_0 = build_norm_layer(norm_cfg, out_channels)[1]
51
52 self.conv0_1 = SubMConv3d(
53 out_channels,
54 out_channels,
55 kernel_size=(3, 1, 3),
56 padding=1,
57 bias=False,
58 indice_key=indice_key + 'bef')
59 self.act0_1 = build_activation_layer(act_cfg)
60 self.bn0_1 = build_norm_layer(norm_cfg, out_channels)[1]
61
62 self.conv1_0 = SubMConv3d(
63 in_channels,
64 out_channels,
65 kernel_size=(3, 1, 3),
66 padding=1,
67 bias=False,
68 indice_key=indice_key + 'bef')
69 self.act1_0 = build_activation_layer(act_cfg)
70 self.bn1_0 = build_norm_layer(norm_cfg, out_channels)[1]
71
72 self.conv1_1 = SubMConv3d(
73 out_channels,
74 out_channels,
75 kernel_size=(1, 3, 3),
76 padding=1,
77 bias=False,
78 indice_key=indice_key + 'bef')

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected