diff --git a/src/models/adapters.py b/src/models/adapters.py index d6bb944..ac4a197 100644 --- a/src/models/adapters.py +++ b/src/models/adapters.py @@ -29,17 +29,18 @@ coloredlogs.install(level="INFO", logger=LOGGER, fmt="%(asctime)s %(name)s %(lev # --------------------------------------------------------------------------- class MonaOp(nn.Module): - """Multi-cognitive visual filter: parallel depthwise convs (3×3, 5×5).""" + """Multi-cognitive visual filter: parallel depthwise convs (3×3, 5×5, 7×7).""" def __init__(self, channels: int) -> None: super().__init__() self.conv3 = nn.Conv2d(channels, channels, kernel_size=3, padding=1, groups=channels) self.conv5 = nn.Conv2d(channels, channels, kernel_size=5, padding=2, groups=channels) + self.conv7 = nn.Conv2d(channels, channels, kernel_size=7, padding=3, groups=channels) self.projector = nn.Conv2d(channels, channels, kernel_size=1) def forward(self, x: torch.Tensor) -> torch.Tensor: identity = x - x = (self.conv3(x) + self.conv5(x)) / 2.0 + identity + x = (self.conv3(x) + self.conv5(x) + self.conv7(x)) / 3.0 + identity return x + self.projector(x)