MCPcopy Create free account
hub / github.com/InternRobotics/EmbodiedScan / _init_layers

Method _init_layers

embodiedscan/models/necks/mink_neck.py:102–126  ·  view source on GitHub ↗

Initialize layers. Args: in_channels (tuple[int]): Number of channels in input tensors. out_channels (int): Number of channels in the neck output tensors. num_classes (int): Number of classes.

(self, in_channels: Tuple[int], out_channels: int,
                     num_classes: int)

Source from the content-addressed store, hash-verified

100 ME.MinkowskiBatchNorm(out_channels), ME.MinkowskiELU())
101
102 def _init_layers(self, in_channels: Tuple[int], out_channels: int,
103 num_classes: int):
104 """Initialize layers.
105
106 Args:
107 in_channels (tuple[int]): Number of channels in input tensors.
108 out_channels (int): Number of channels in the neck output tensors.
109 num_classes (int): Number of classes.
110 """
111 # neck layers
112 self.pruning = ME.MinkowskiPruning()
113 for i in range(len(in_channels)):
114 if i > 0:
115 self.__setattr__(
116 f'up_block_{i}',
117 self._make_up_block(in_channels[i], in_channels[i - 1]))
118 self.__setattr__(f'out_block_{i}',
119 self._make_block(in_channels[i], out_channels))
120
121 # head layers
122 self.conv_cls = ME.MinkowskiConvolution(out_channels,
123 num_classes,
124 kernel_size=1,
125 bias=True,
126 dimension=3)
127
128 def init_weights(self):
129 """Initialize weights."""

Callers 1

__init__Method · 0.95

Calls 3

_make_up_blockMethod · 0.95
_make_blockMethod · 0.95
__setattr__Method · 0.80

Tested by

no test coverage detected