(self, dim, reduction=1, lambda_c=0.5, lambda_s=0.5)
| 51 | # FRM |
| 52 | class FeatureRectifyModule(nn.Module): |
| 53 | def __init__(self, dim, reduction=1, lambda_c=0.5, lambda_s=0.5): |
| 54 | super(FeatureRectifyModule, self).__init__() |
| 55 | self.lambda_c = lambda_c |
| 56 | self.lambda_s = lambda_s |
| 57 | self.channel_weights = ChannelWeights(dim=dim, reduction=reduction) |
| 58 | self.spatial_weights = SpatialWeights(dim=dim, reduction=reduction) |
| 59 | |
| 60 | def _init_weights(self, m): |
| 61 | if isinstance(m, nn.Linear): |
nothing calls this directly
no test coverage detected