SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.15332 · CVPR · 2022

Balanced Multimodal Learning via On-the-fly Gradient Modulation

Di Hu, Dong Wang, Yake Wei, Andong Deng, Xiaokang Peng

arXiv · PDF · Open in the Atlas

Code that ran

3 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2203.15332.json · badge: /api/ran/2203.15332.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
GeWu-Lab/OGM-GE_CVPR2022 community
Papers with Code archive
3 ran · 5 no recorded run
FunctionStatusWhere it lives
ConcatFusion Ran
ran on a synthesized input
GeWu-Lab/OGM-GE_CVPR2022/models/basic_model.py
code served (permissive licence) · get_code("48177bc8c5883df6")
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 tuple. 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

class ConcatFusion(nn.Module):

    def __init__(self, input_dim=1024, output_dim=100):
        super(ConcatFusion, self).__init__()
        self.fc_out = nn.Linear(input_dim, output_dim)

    def forward(self, x, y):
        output = torch.cat((x, y), dim=1)
        output = self.fc_out(output)
        return (x, y, output)


INIT_ARGS = {
    'input_dim': 8,
    'output_dim': 5
}

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

if __name__ == '__main__':
    model = ConcatFusion(**INIT_ARGS)
    result = model(**ARGS)
    print("Output shapes:")
    print(f"  x shape: {result[0].shape}")
    print(f"  y shape: {result[1].shape}")
    print(f"  fused output shape: {result[2].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 tuple — a tuple output has no array shape of its own; none is 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GatedFusion Ran
ran on a synthesized input
GeWu-Lab/OGM-GE_CVPR2022/models/basic_model.py
code served (permissive licence) · get_code("de31f8fee4527657")
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 tuple. 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

class GatedFusion(nn.Module):
    """
    Efficient Large-Scale Multi-Modal Classification,
    https://arxiv.org/pdf/1802.02892.pdf.
    """

    def __init__(self, input_dim=512, dim=512, output_dim=100, x_gate=True):
        super(GatedFusion, self).__init__()
        self.fc_x = nn.Linear(input_dim, dim)
        self.fc_y = nn.Linear(input_dim, dim)
        self.fc_out = nn.Linear(dim, output_dim)
        self.x_gate = x_gate
        self.sigmoid = nn.Sigmoid()

    def forward(self, x, y):
        out_x = self.fc_x(x)
        out_y = self.fc_y(y)
        if self.x_gate:
            gate = self.sigmoid(out_x)
            output = self.fc_out(torch.mul(gate, out_y))
        else:
            gate = self.sigmoid(out_y)
            output = self.fc_out(torch.mul(out_x, gate))
        return (out_x, out_y, output)


INIT_ARGS = {
    'input_dim': 4,
    'dim': 8,
    'output_dim': 3,
    'x_gate': True,
}

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

if __name__ == '__main__':
    model = GatedFusion(**INIT_ARGS)
    out_x, out_y, output = model(**ARGS)
    print(f"out_x shape: {out_x.shape}")
    print(f"out_y shape: {out_y.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 tuple — a tuple output has no array shape of its own; none is 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SumFusion Ran
ran on a synthesized input
GeWu-Lab/OGM-GE_CVPR2022/models/basic_model.py
code served (permissive licence) · get_code("579830cf6d703855")
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 tuple. 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 numpy as np
from scipy import stats

INIT_ARGS = {
    "input_dim": 4,
    "output_dim": 3,
}

# Create input tensors for forward pass
x = torch.randn(2, 4)  # batch_size=2, input_dim=4
y = torch.randn(2, 4)  # batch_size=2, input_dim=4

ARGS = {
    "x": x,
    "y": y,
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
AVClassifier Not yet run
unverified (harvested, no recorded run)
GeWu-Lab/OGM-GE_CVPR2022/models/basic_model.py
code served (permissive licence) · get_code("58acbad04b63ec6f")
How it ran

no invocation recorded.

FiLM Not yet run
unverified (harvested, no recorded run)
GeWu-Lab/OGM-GE_CVPR2022/models/basic_model.py
code served (permissive licence) · get_code("713cd9da0b658745")
How it ran

no invocation recorded.

ResNet Not yet run
unverified (harvested, no recorded run)
GeWu-Lab/OGM-GE_CVPR2022/models/basic_model.py
code served (permissive licence) · get_code("477f37d037723674")
How it ran

no invocation recorded.

_resnet Not yet run
unverified (harvested, no recorded run)
GeWu-Lab/OGM-GE_CVPR2022/models/basic_model.py
code served (permissive licence) · get_code("fc6115557015275e")
How it ran

no invocation recorded.

resnet18 Not yet run
unverified (harvested, no recorded run)
GeWu-Lab/OGM-GE_CVPR2022/models/basic_model.py
code served (permissive licence) · get_code("f3c834e82ebe728e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 6 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.

FunctionAlso present inEarliest-datedOthers named
resnet18
brick of this paper's assembly: helper
7 other papers
7 later
2302.10912 (2023-02)
Balanced Audiovisual Dataset for Imbalance Analysis
2308.07686 (2023-08)
Boosting Multi-modal Model Performance with Adaptive Gradient Modulation
2405.09321 (2024-05)
ReconBoost: Boosting Can Achieve Modality Reconcilement
and 4 more not named here
_resnet
brick of this paper's assembly: helper
1 other paper
1 later
2502.20120 (2025-02)
Rethinking Multimodal Learning from the Perspective of Mitigating Classification Ability Disproportion

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-22.

Repositories linked to this paper

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

Abstract

Multimodal learning helps to comprehensively understand the world, by integrating different senses. Accordingly, multiple input modalities are expected to boost model performance, but we actually find that they are not fully exploited even when the multimodal model outperforms its uni-modal counterpart. Specifically, in this paper we point out that existing multimodal discriminative models, in which uniform objective is designed for all modalities, could remain under-optimized uni-modal representations, caused by another dominated modality in some scenarios, e.g., sound in blowing wind event, vision in drawing picture event, etc. To alleviate this optimization imbalance, we propose on-the-fly gradient modulation to adaptively control the optimization of each modality, via monitoring the discrepancy of their contribution towards the learning objective. Further, an extra Gaussian noise that changes dynamically is introduced to avoid possible generalization drop caused by gradient modulation. As a result, we achieve considerable improvement over common fusion methods on different multimodal tasks, and this simple strategy can also boost existing multimodal methods, which illustrates its efficacy and versatility. The source code is available at https://github.com/GeWu-Lab/OGM-GE_CVPR2022.

For agents

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

get_harvested_code_for_paper("2203.15332")
get_code_for_paper("2203.15332")
have("2203.15332")

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

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

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

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

Connect an agent — have() is free.