SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.17343 · NeurIPS · 2023

Modality-Independent Teachers Meet Weakly-Supervised Audio-Visual Event Parser

Yen-Chun Chen, Yu-Chiang Wang, Yung-Hsuan Lai

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 failures of our instrument; 0 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/2305.17343.json · badge: /api/ran/2305.17343.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
franklin905/valor canonical (classifier label)
classifier basis: classifier_2025
6 ran · 0 no recorded run
FunctionStatusWhere it lives
Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
franklin905/valor/main_network.py
code served (permissive licence) · get_code("8a304d0a3286f726")
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, Encoder: 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
import copy

torch.manual_seed(0)

# Create a minimal encoder layer that matches the expected interface
class MinimalEncoderLayer(nn.Module):
    def __init__(self, hidden_dim):
        super(MinimalEncoderLayer, self).__init__()
        self.linear = nn.Linear(hidden_dim, hidden_dim)
    
    def forward(self, norm_where, src, src_cross, src_mask=None, src_key_padding_mask=None, with_ca=False):
        # Simple pass-through with linear transformation
        return self.linear(src)

# Setup parameters
hidden_dim = 4
num_layers = 2

encoder_layer = MinimalEncoderLayer(hidden_dim)

ARGS = {
    'encoder_layer': encoder_layer,
    'num_layers': num_layers,
    'hidden_dim': hidden_dim
}
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 Encoder — 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 Encoder 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
HANLayer Ran
ran on a synthesized input
franklin905/valor/main_network.py
code served (permissive licence) · get_code("1b59756c726a0190")
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 3, 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 HANLayer(nn.Module):

    def __init__(self, d_model, nhead, dim_feedforward=512, dropout=0.1):
        super(HANLayer, self).__init__()
        self.self_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
        self.cm_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout)
        self.linear1 = nn.Linear(d_model, dim_feedforward)
        self.dropout = nn.Dropout(dropout)
        self.linear2 = nn.Linear(dim_feedforward, d_model)
        self.norm1 = nn.LayerNorm(d_model)
        self.norm2 = nn.LayerNorm(d_model)
        self.dropout11 = nn.Dropout(dropout)
        self.dropout12 = nn.Dropout(dropout)
        self.dropout2 = nn.Dropout(dropout)
        self.activation = nn.ReLU()

    def forward(self, norm_where, src_q, src_v, src_mask=None, src_key_padding_mask=None, with_ca=True):
        """Pass the input through the encoder layer.

        Args:
            src: the sequnce to the encoder layer (required).
            src_mask: the mask for the src sequence (optional).
            src_key_padding_mask: the mask for the src keys per batch (optional).

        Shape:
            see the docs in Transformer class.
        """
        src_q = src_q.permute(1, 0, 2)
        src_v = src_v.permute(1, 0, 2)
        if norm_where == 'post_norm':
            if with_ca:
                src1 = self.cm_attn(src_q, src_v, src_v, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
                src2 = self.self_attn(src_q, src_q, src_q, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
                src_q = src_q + self.dropout11(src1) + self.dropout12(src2)
                src_q = self.norm1(src_q)
            else:
                src2 = self.self_attn(src_q, src_q, src_q, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
                src_q = src_q + self.dropout12(src2)
                src_q = self.norm1(src_q)
            src2 = self.linear2(self.dropout(F.relu(self.linear1(src_q))))
            src_q = src_q + self.dropout2(src2)
            src_q = self.norm2(src_q)
            return src_q.permute(1, 0, 2)
        elif norm_where == 'pre_norm':
            src_q_pre_norm = self.norm1(src_q)
            if with_ca:
                src1 = self.cm_attn(src_q_pre_norm, src_v, src_v, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
                src2 = self.self_attn(src_q_pre_norm, src_q_pre_norm, src_q_pre_norm, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
                src_q = src_q + self.dropout11(src1) + self.dropout12(src2)
            else:
                src2 = self.self_attn(src_q_pre_norm, src_q_pre_norm, src_q_pre_norm, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
                src_q = src_q + self.dropout12(src2)
            src_q_pre_norm = self.norm2(src_q)
            src2 = self.linear2(self.dropout(F.relu(self.linear1(src_q_pre_norm))))
            src_q = src_q + self.dropout2(src2)
            return src_q.permute(1, 0, 2)
        else:
            raise ValueError('norm_where should be pre_norm or post_norm')


INIT_ARGS = {
    'd_model': 4,
    'nhead': 2,
    'dim_feedforward': 8,
    'dropout': 0.1,
}

ARGS = {
    'norm_where': 'post_norm',
    'src_q': torch.randn(2, 3, 4),
    'src_v': torch.randn(2, 3, 4),
    'src_mask': None,
    'src_key_padding_mask': None,
    'with_ca': True,
}

if __name__ == '__main__':
    layer = HANLayer(**INIT_ARGS)
    output = layer(**ARGS)
    print("Output shape:", output.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 3, 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)
MMIL_Net Ran
ran on a synthesized input · constructed an object; no result was computed
franklin905/valor/main_network.py
code served (permissive licence) · get_code("c8dc66cfe7a9f25f")
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, MMIL_Net: 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 Args:
    def __init__(self):
        self.hidden_dim = 64
        self.input_a_dim = 128
        self.input_v_dim = 256
        self.nhead = 4
        self.ff_dim = 256
        self.num_layers = 2
        self.norm_where = 'pre_norm'

ARGS = {
    'args': Args()
}
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 MMIL_Net — 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 MMIL_Net 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
calculate_visual_logits Ran
ran; our contract draft was wrong, not the code
franklin905/valor/utils/clip_preprocess.py
code served (permissive licence) · get_code("35620d66f621636d")
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) and returned Tensor, ndim 2, dtype family float, shape (10, 25) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Create a minimal mock CLIP model that satisfies the function's usage
class MockCLIPModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 25)  # Projects to 25 logits (number of categories)
    
    def forward(self, pixel_values, **kwargs):
        # pixel_values shape: (10, 3, 4, 4)
        # Flatten and process to get logits_per_image of shape (10, 25)
        batch_size = pixel_values.shape[0]
        flattened = pixel_values.view(batch_size, -1)
        # Project to 25 logits
        logits = self.linear(flattened[:, :4])  # Use first 4 features
        
        # Return object with logits_per_image attribute
        class Output:
            def __init__(self, logits_per_image):
                self.logits_per_image = logits_per_image
        
        return Output(logits_per_image=logits)

# Construct arguments
model = MockCLIPModel()

# video_frames: (10, 3, H, W) - 10 frames, 3 channels, small spatial dims
video_frames = torch.randn(10, 3, 4, 4)

# event_captions: dict with keys that will be passed to model
# The function unpacks this dict into the model call
event_captions = {
    'input_ids': torch.randint(0, 100, (25, 8)),  # 25 captions, 8 tokens each
    'attention_mask': torch.ones(25, 8)
}

device = torch.device('cpu')

ARGS = {
    'model': model,
    'video_frames': video_frames,
    'event_captions': event_captions,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 2, dtype family float, shape (10, 25) — shape (10, 25) as a later run recorded it
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: none by the harness; any seed is in the setup block
get_segment_pseudo_labels Ran
ran; our contract draft was wrong, not the code
franklin905/valor/utils/clip_preprocess.py
code served (permissive licence) · get_code("f6a88207a31366e0")
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) and returned Tensor, ndim 2, dtype family int, shape (10, 25) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# logits_image_text: tensor of shape (num_segments, num_events)
# Should be (10, 25) based on output Pv shape and indexing
logits_image_text = torch.randn(10, 25)

# thresholds: tensor of shape (num_segments, num_events)
# Same shape as logits_image_text for broadcasting in comparison
thresholds = torch.randn(10, 25)

# labels: tensor indicating which events occurred (video-level labels)
# Shape (25,) with some 1s and 0s to indicate occurred events
labels = torch.zeros(25)
labels[[2, 5, 7, 12]] = 1  # Mark some events as occurred

# device: torch device
device = torch.device("cpu")

ARGS = {
    "logits_image_text": logits_image_text,
    "thresholds": thresholds,
    "labels": labels,
    "device": device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 2, dtype family int, shape (10, 25) — shape (10, 25) as a later run recorded it
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: none by the harness; any seed is in the setup block
ids_to_multinomial Ran
ran, honoured the contract we drafted
franklin905/valor/utils/clip_preprocess.py
code served (permissive licence) · get_code("db063d7b018f83a8")
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) and returned ndarray, ndim 1, dtype family float, shape (25,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

# The function takes a list of class indices (category names from the predefined list)
# and returns a multi-label one-hot encoded vector

ARGS = {
    "ids": ["Speech", "Car", "Dog", "Singing"]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (25,) — shape (25,) as a later run recorded it
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: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 3 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
Encoder
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2505.23155 (2025-05)
PreFM: Online Audio-Visual Event Parsing via Predictive Future Modeling
HANLayer
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2505.23155 (2025-05)
PreFM: Online Audio-Visual Event Parsing via Predictive Future Modeling
ids_to_multinomial 1 other paper
1 dated earlier
2111.12374 (2021-11)
MM-Pyramid: Multimodal Pyramid Attentional Network for Audio-Visual Event Localization and Video Parsing

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

Audio-visual learning has been a major pillar of multi-modal machine learning, where the community mostly focused on its modality-aligned setting, i.e., the audio and visual modality are both assumed to signal the prediction target. With the Look, Listen, and Parse dataset (LLP), we investigate the under-explored unaligned setting, where the goal is to recognize audio and visual events in a video with only weak labels observed. Such weak video-level labels only tell what events happen without knowing the modality they are perceived (audio, visual, or both). To enhance learning in this challenging setting, we incorporate large-scale contrastively pre-trained models as the modality teachers. A simple, effective, and generic method, termed Visual-Audio Label Elaboration (VALOR), is innovated to harvest modality labels for the training events. Empirical studies show that the harvested labels significantly improve an attentional baseline by 8.0 in average F-score (Type@AV). Surprisingly, we found that modality-independent teachers outperform their modality-fused counterparts since they are noise-proof from the other potentially unaligned modality. Moreover, our best model achieves the new state-of-the-art on all metrics of LLP by a substantial margin (+5.4 F-score for Type@AV). VALOR is further generalized to Audio-Visual Event Localization and achieves the new state-of-the-art as well. 1

For agents

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

get_harvested_code_for_paper("2305.17343")
get_code_for_paper("2305.17343")
have("2305.17343")

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

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

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

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

Connect an agent — have() is free.