SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.03295 · ICLR · 2024

MogaNet: Multi-order Gated Aggregation Network

Zicheng Liu, Siyuan Li, Stan Li, Di Wu, Cheng Tan, Zedong Wang, Haitao Lin, Zhiyuan Chen, Jiangbin Zheng

arXiv · PDF · Open in the Atlas

Code that ran

12 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 2 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2211.03295.json · badge: /api/ran/2211.03295.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
Westlake-AI/MogaNet canonical (classifier label)
classifier basis: classifier_2025
9 ran · 2 no recorded run
chengtan9907/OpenSTL marked official in Papers with Code
Papers with Code archive
3 ran · 1 no recorded run
FunctionStatusWhere it lives
ChannelAggregationFFN Ran
ran on a synthesized input · constructed an object; no result was computed
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("cc2b8b29fdd8ae54")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ChannelAggregationFFN: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class ElementScale(nn.Module):
    """A learnable element-wise scaler."""

    def __init__(self, embed_dims, init_value=0.0, requires_grad=True):
        super(ElementScale, self).__init__()
        self.scale = nn.Parameter(init_value * torch.ones((1, embed_dims, 1, 1)), requires_grad=requires_grad)

    def forward(self, x):
        return x * self.scale

def build_act_layer(act_type):
    """Build activation layer."""
    if act_type is None:
        return nn.Identity()
    assert act_type in ['GELU', 'ReLU', 'SiLU']
    if act_type == 'SiLU':
        return nn.SiLU()
    elif act_type == 'ReLU':
        return nn.ReLU()
    else:
        return nn.GELU()

class ChannelAggregationFFN(nn.Module):
    """An implementation of FFN with Channel Aggregation."""

    def __init__(self, embed_dims, feedforward_channels, kernel_size=3, act_type='GELU', ffn_drop=0.0):
        super(ChannelAggregationFFN, self).__init__()
        self.embed_dims = embed_dims
        self.feedforward_channels = feedforward_channels
        self.fc1 = nn.Conv2d(in_channels=embed_dims, out_channels=self.feedforward_channels, kernel_size=1)
        self.dwconv = nn.Conv2d(in_channels=self.feedforward_channels, out_channels=self.feedforward_channels, kernel_size=kernel_size, stride=1, padding=kernel_size // 2, bias=True, groups=self.feedforward_channels)
        self.act = build_act_layer(act_type)
        self.fc2 = nn.Conv2d(in_channels=feedforward_channels, out_channels=embed_dims, kernel_size=1)
        self.drop = nn.Dropout(ffn_drop)
        self.decompose = nn.Conv2d(in_channels=self.feedforward_channels, out_channels=1, kernel_size=1)
        self.sigma = ElementScale(self.feedforward_channels, init_value=1e-05, requires_grad=True)
        self.decompose_act = build_act_layer(act_type)

    def feat_decompose(self, x):
        x = x + self.sigma(x - self.decompose_act(self.decompose(x)))
        return x

    def forward(self, x):
        x = self.fc1(x)
        x = self.dwconv(x)
        x = self.act(x)
        x = self.drop(x)
        x = self.feat_decompose(x)
        x = self.fc2(x)
        x = self.drop(x)
        return x

ARGS = {
    'embed_dims': 4,
    'feedforward_channels': 8,
    'kernel_size': 3,
    'act_type': 'GELU',
    'ffn_drop': 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ChannelAggregationFFN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ChannelAggregationFFN output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ChannelAggregationFFN Ran
ran on a synthesized input · constructed an object; no result was computed
chengtan9907/OpenSTL/openstl/modules/simvp_modules.py
code served (permissive licence) · get_code("cf05fdcf563e2f19")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ChannelAggregationFFN: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define parameters for ChannelAggregationFFN
embed_dims = 4
mlp_hidden_dims = 8
kernel_size = 3
act_layer = nn.GELU
ffn_drop = 0.1

ARGS = {
    "embed_dims": embed_dims,
    "mlp_hidden_dims": mlp_hidden_dims,
    "kernel_size": kernel_size,
    "act_layer": act_layer,
    "ffn_drop": ffn_drop,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ChannelAggregationFFN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ChannelAggregationFFN output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ConvPatchEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("415533ec94ba9379")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ConvPatchEmbed: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define ARGS dict with all parameters for ConvPatchEmbed.__init__
ARGS = {
    'in_channels': 3,
    'embed_dims': 64,
    'kernel_size': 3,
    'stride': 2,
    'norm_type': 'BN'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ConvPatchEmbed — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ConvPatchEmbed output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ElementScale Ran
ran on a synthesized input · constructed an object; no result was computed
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("f347afec9d2fadaa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ElementScale: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "embed_dims": 4,
    "init_value": 0.0,
    "requires_grad": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ElementScale — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ElementScale output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
LayerNorm2d Ran
ran on a synthesized input · constructed an object; no result was computed
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("080b40f8bc571c80")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, LayerNorm2d: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# LayerNorm2d.__init__ parameters:
# - normalized_shape: int or tuple
# - eps: float (default 1e-06)
# - data_format: str (default 'channels_last')

# LayerNorm2d.forward uses:
# - x: tensor
# - self.normalized_shape, self.weight, self.bias, self.eps
# - F.layer_norm for channels_last
# - Manual normalization for channels_first

# Create test inputs for both data formats
# channels_last: (batch, height, width, channels)
x_channels_last = torch.randn(2, 3, 4, 5)

# channels_first: (batch, channels, height, width)
x_channels_first = torch.randn(2, 5, 3, 4)

ARGS = {
    'normalized_shape': 5,
    'eps': 1e-06,
    'data_format': 'channels_last'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LayerNorm2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LayerNorm2d output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
MultiOrderDWConv Ran
ran on a synthesized input
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("34e96c682001e3a4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class MultiOrderDWConv(nn.Module):
    """Multi-order Features with Dilated DWConv Kernel.

    Args:
        embed_dims (int): Number of input channels.
        dw_dilation (list): Dilations of three DWConv layers.
        channel_split (list): The raletive ratio of three splited channels.
    """

    def __init__(self, embed_dims, dw_dilation=[1, 2, 3], channel_split=[1, 3, 4]):
        super(MultiOrderDWConv, self).__init__()
        self.split_ratio = [i / sum(channel_split) for i in channel_split]
        self.embed_dims_1 = int(self.split_ratio[1] * embed_dims)
        self.embed_dims_2 = int(self.split_ratio[2] * embed_dims)
        self.embed_dims_0 = embed_dims - self.embed_dims_1 - self.embed_dims_2
        self.embed_dims = embed_dims
        assert len(dw_dilation) == len(channel_split) == 3
        assert 1 <= min(dw_dilation) and max(dw_dilation) <= 3
        assert embed_dims % sum(channel_split) == 0
        self.DW_conv0 = nn.Conv2d(in_channels=self.embed_dims, out_channels=self.embed_dims, kernel_size=5, padding=(1 + 4 * dw_dilation[0]) // 2, groups=self.embed_dims, stride=1, dilation=dw_dilation[0])
        self.DW_conv1 = nn.Conv2d(in_channels=self.embed_dims_1, out_channels=self.embed_dims_1, kernel_size=5, padding=(1 + 4 * dw_dilation[1]) // 2, groups=self.embed_dims_1, stride=1, dilation=dw_dilation[1])
        self.DW_conv2 = nn.Conv2d(in_channels=self.embed_dims_2, out_channels=self.embed_dims_2, kernel_size=7, padding=(1 + 6 * dw_dilation[2]) // 2, groups=self.embed_dims_2, stride=1, dilation=dw_dilation[2])
        self.PW_conv = nn.Conv2d(in_channels=embed_dims, out_channels=embed_dims, kernel_size=1)

    def forward(self, x):
        x_0 = self.DW_conv0(x)
        x_1 = self.DW_conv1(x_0[:, self.embed_dims_0:self.embed_dims_0 + self.embed_dims_1, ...])
        x_2 = self.DW_conv2(x_0[:, self.embed_dims - self.embed_dims_2:, ...])
        x = torch.cat([x_0[:, :self.embed_dims_0, ...], x_1, x_2], dim=1)
        x = self.PW_conv(x)
        return x


INIT_ARGS = {
    'embed_dims': 8,
    'dw_dilation': [1, 2, 3],
    'channel_split': [1, 3, 4]
}

ARGS = {
    'x': torch.randn(2, 8, 4, 3)
}

if __name__ == '__main__':
    model = MultiOrderDWConv(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MultiOrderDWConv Ran
ran on a synthesized input · constructed an object; no result was computed
chengtan9907/OpenSTL/openstl/modules/simvp_modules.py
code served (permissive licence) · get_code("528b9b4cc6a8170a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, MultiOrderDWConv: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Construct valid arguments for MultiOrderDWConv
ARGS = {
    'embed_dims': 8,
    'dw_dilation': [1, 2, 3],
    'channel_split': [1, 3, 4]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MultiOrderDWConv — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiOrderDWConv output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
MultiOrderGatedAggregation Ran
ran on a synthesized input
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("629c8ffe83ae92cb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# INIT_ARGS for MultiOrderGatedAggregation.__init__
INIT_ARGS = {
    'embed_dims': 8,  # Must be divisible by sum(attn_channel_split) = 1+3+4 = 8
    'attn_dw_dilation': [1, 2, 3],
    'attn_channel_split': [1, 3, 4],
    'attn_act_type': 'SiLU',
    'attn_force_fp32': False
}

# ARGS for MultiOrderGatedAggregation.forward
# Input tensor shape: (batch, embed_dims, height, width)
ARGS = {
    'x': torch.randn(2, 8, 7, 5)  # batch=2, channels=8, height=7, width=5
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MultiOrderGatedAggregation Ran
ran on a synthesized input
chengtan9907/OpenSTL/openstl/modules/simvp_modules.py
code served (permissive licence) · get_code("c06bcd5ffc9492cb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

class MultiOrderDWConv(nn.Module):
    """Multi-order Features with Dilated DWConv Kernel in MogaNet."""

    def __init__(self, embed_dims, dw_dilation=[1, 2, 3], channel_split=[1, 3, 4]):
        super(MultiOrderDWConv, self).__init__()
        self.split_ratio = [i / sum(channel_split) for i in channel_split]
        self.embed_dims_1 = int(self.split_ratio[1] * embed_dims)
        self.embed_dims_2 = int(self.split_ratio[2] * embed_dims)
        self.embed_dims_0 = embed_dims - self.embed_dims_1 - self.embed_dims_2
        self.embed_dims = embed_dims
        assert len(dw_dilation) == len(channel_split) == 3
        assert 1 <= min(dw_dilation) and max(dw_dilation) <= 3
        assert embed_dims % sum(channel_split) == 0
        self.DW_conv0 = nn.Conv2d(in_channels=self.embed_dims, out_channels=self.embed_dims, kernel_size=5, padding=(1 + 4 * dw_dilation[0]) // 2, groups=self.embed_dims, stride=1, dilation=dw_dilation[0])
        self.DW_conv1 = nn.Conv2d(in_channels=self.embed_dims_1, out_channels=self.embed_dims_1, kernel_size=5, padding=(1 + 4 * dw_dilation[1]) // 2, groups=self.embed_dims_1, stride=1, dilation=dw_dilation[1])
        self.DW_conv2 = nn.Conv2d(in_channels=self.embed_dims_2, out_channels=self.embed_dims_2, kernel_size=7, padding=(1 + 6 * dw_dilation[2]) // 2, groups=self.embed_dims_2, stride=1, dilation=dw_dilation[2])
        self.PW_conv = nn.Conv2d(in_channels=embed_dims, out_channels=embed_dims, kernel_size=1)

    def forward(self, x):
        x_0 = self.DW_conv0(x)
        x_1 = self.DW_conv1(x_0[:, self.embed_dims_0:self.embed_dims_0 + self.embed_dims_1, ...])
        x_2 = self.DW_conv2(x_0[:, self.embed_dims - self.embed_dims_2:, ...])
        x = torch.cat([x_0[:, :self.embed_dims_0, ...], x_1, x_2], dim=1)
        x = self.PW_conv(x)
        return x

class MultiOrderGatedAggregation(nn.Module):
    """Spatial Block with Multi-order Gated Aggregation in MogaNet."""

    def __init__(self, embed_dims, attn_dw_dilation=[1, 2, 3], attn_channel_split=[1, 3, 4], attn_shortcut=True):
        super(MultiOrderGatedAggregation, self).__init__()
        self.embed_dims = embed_dims
        self.attn_shortcut = attn_shortcut
        self.proj_1 = nn.Conv2d(in_channels=embed_dims, out_channels=embed_dims, kernel_size=1)
        self.gate = nn.Conv2d(in_channels=embed_dims, out_channels=embed_dims, kernel_size=1)
        self.value = MultiOrderDWConv(embed_dims=embed_dims, dw_dilation=attn_dw_dilation, channel_split=attn_channel_split)
        self.proj_2 = nn.Conv2d(in_channels=embed_dims, out_channels=embed_dims, kernel_size=1)
        self.act_value = nn.SiLU()
        self.act_gate = nn.SiLU()
        self.sigma = nn.Parameter(1e-05 * torch.ones((1, embed_dims, 1, 1)), requires_grad=True)

    def feat_decompose(self, x):
        x = self.proj_1(x)
        x_d = F.adaptive_avg_pool2d(x, output_size=1)
        x = x + self.sigma * (x - x_d)
        x = self.act_value(x)
        return x

    def forward(self, x):
        if self.attn_shortcut:
            shortcut = x.clone()
        x = self.feat_decompose(x)
        g = self.gate(x)
        v = self.value(x)
        x = self.proj_2(self.act_gate(g) * self.act_gate(v))
        if self.attn_shortcut:
            x = x + shortcut
        return x


INIT_ARGS = {
    'embed_dims': 8,
    'attn_dw_dilation': [1, 2, 3],
    'attn_channel_split': [1, 3, 4],
    'attn_shortcut': True,
}

ARGS = {
    'x': torch.randn(2, 8, 4, 3),
}

if __name__ == '__main__':
    model = MultiOrderGatedAggregation(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: {ARGS['x'].shape}")
    assert output.shape == ARGS['x'].shape, f"Shape mismatch: {output.shape} vs {ARGS['x'].shape}"
    print("Test passed!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
StackConvPatchEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("46949c7157f260ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, StackConvPatchEmbed: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_channels': 3,
    'embed_dims': 64,
    'kernel_size': 3,
    'stride': 2,
    'act_type': 'GELU',
    'norm_type': 'BN'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type StackConvPatchEmbed — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a StackConvPatchEmbed output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_act_layer Ran
ran; our contract draft was wrong, not the code
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("63ec6cf8064edb07")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ReLU. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function build_act_layer takes a single parameter: act_type
# It checks if act_type is None or one of ['GELU', 'ReLU', 'SiLU']
# and returns the corresponding activation layer

ARGS = {
    'act_type': 'ReLU'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_norm_layer Ran
ran; our contract draft was wrong, not the code
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("176cfedc20e4532c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned LayerNorm2d. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function build_norm_layer takes two parameters:
# 1. norm_type: a string that must be one of ['BN', 'GN', 'LN2d', 'SyncBN']
# 2. embed_dims: an integer representing the number of channels/dimensions

ARGS = {
    'norm_type': 'LN2d',
    'embed_dims': 64
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LayerNorm2d — a LayerNorm2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LayerNorm2d output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
MogaBlock Not yet run
unverified (harvested, no recorded run)
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("1b34bbc3671c6f4a")
How it ran

no invocation recorded.

MogaNet Not yet run
unverified (harvested, no recorded run)
Westlake-AI/MogaNet/models/moganet.py
code served (permissive licence) · get_code("8e113d262a51881c")
How it ran

no invocation recorded.

MogaSubBlock Not yet run
unverified (harvested, no recorded run)
chengtan9907/OpenSTL/openstl/modules/simvp_modules.py
code served (permissive licence) · get_code("e17304f230d6cf53")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 14 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

By contextualizing the kernel as global as possible, Modern ConvNets have shown great potential in computer vision tasks. However, recent progress on multi-order game-theoretic interaction within deep neural networks (DNNs) reveals the representation bottleneck of modern ConvNets, where the expressive interactions have not been effectively encoded with the increased kernel size. To tackle this challenge, we propose a new family of modern ConvNets, dubbed MogaNet, for discriminative visual representation learning in pure ConvNet-based models with favorable complexity-performance trade-offs. MogaNet encapsulates conceptually simple yet effective convolutions and gated aggregation into a compact module, where discriminative features are efficiently gathered and contextualized adaptively. MogaNet exhibits great scalability, impressive efficiency of parameters, and competitive performance compared to state-of-the-art ViTs and ConvNets on ImageNet and various downstream vision benchmarks, including COCO object detection, ADE20K semantic segmentation, 2D&3D human pose estimation, and video prediction. Notably, MogaNet hits 80.0% and 87.8% accuracy with 5.2M and 181M parameters on ImageNet-1K, outperforming ParC-Net and ConvNeXt-L, while saving 59% FLOPs and 17M parameters, respectively. The source code is available at https://github.com/Westlake-AI/MogaNet.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2211.03295")
get_code_for_paper("2211.03295")
have("2211.03295")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2211.03295.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2211.03295.svg)](https://syntology.ai/paper/2211.03295)

Connect an agent — have() is free.