(
self,
in_channels,
out_channels,
stride=2,
norm_layer=None,
act_layer=None,
reduce="max",
shuffle_orders=True,
traceable=True, # record parent and cluster
)
| 608 | |
| 609 | class SerializedPooling(PointModule): |
| 610 | def __init__( |
| 611 | self, |
| 612 | in_channels, |
| 613 | out_channels, |
| 614 | stride=2, |
| 615 | norm_layer=None, |
| 616 | act_layer=None, |
| 617 | reduce="max", |
| 618 | shuffle_orders=True, |
| 619 | traceable=True, # record parent and cluster |
| 620 | ): |
| 621 | super().__init__() |
| 622 | self.in_channels = in_channels |
| 623 | self.out_channels = out_channels |
| 624 | |
| 625 | assert stride == 2 ** (math.ceil(stride) - 1).bit_length() # 2, 4, 8 |
| 626 | # TODO: add support to grid pool (any stride) |
| 627 | self.stride = stride |
| 628 | assert reduce in ["sum", "mean", "min", "max"] |
| 629 | self.reduce = reduce |
| 630 | self.shuffle_orders = shuffle_orders |
| 631 | self.traceable = traceable |
| 632 | |
| 633 | self.proj = nn.Linear(in_channels, out_channels) |
| 634 | if norm_layer is not None: |
| 635 | self.norm = PointSequential(norm_layer(out_channels)) |
| 636 | if act_layer is not None: |
| 637 | self.act = PointSequential(act_layer()) |
| 638 | |
| 639 | def forward(self, point: Point): |
| 640 | pooling_depth = (math.ceil(self.stride) - 1).bit_length() |
nothing calls this directly
no test coverage detected