SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.29850 · 2026

MIRAGE: Adaptive Multimodal Gating for Whole-Brain fMRI Encoding

Martin Schrimpf, Badr Alkhamissi, Abdulkadir Gocke

arXiv · PDF · Open in the Atlas

Code that ran

30 of 41 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (13 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 21 have no contract verdict; 7 failures of our instrument; 11 no recorded run), measured 2026-11-24; 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/2605.29850.json · badge: /api/ran/2605.29850.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
epflneuroailab/mirage community
Papers with Code archive
30 ran · 11 no recorded run
FunctionStatusWhere it lives
AdaptiveAvgTemporalReducer Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("bdf34d142202b61a")
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, AdaptiveAvgTemporalReducer: 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 ARGS for AdaptiveAvgTemporalReducer.__init__
ARGS = {
    'n_output_timesteps': 3
}
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 AdaptiveAvgTemporalReducer — 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 AdaptiveAvgTemporalReducer 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
CatAggregator Ran
ran on a synthesized input
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("c2594d1e4d22954e")
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 2, dtype family float, shape (2, 12) 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

class CatAggregator(nn.Module):
    """Concatenate projected modality features along the last dim."""

    def forward(self, modality_features: dict[str, torch.Tensor], subject_id: torch.Tensor | None=None) -> torch.Tensor:
        tensors = list(modality_features.values())
        return torch.cat(tensors, dim=-1)


INIT_ARGS = {}

ARGS = {
    "modality_features": {
        "modality_1": torch.randn(2, 4),
        "modality_2": torch.randn(2, 3),
        "modality_3": torch.randn(2, 5),
    },
    "subject_id": None,
}

if __name__ == "__main__":
    model = CatAggregator(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
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 2, dtype family float, shape (2, 12) — shape (2, 12) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
CatLayerPooler Ran
ran on a synthesized input
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("29dd6bc71fee2173")
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
from einops import rearrange

class CatLayerPooler(nn.Module):
    """Concatenate all layers along the channel dimension."""

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return rearrange(x, 'b l t d -> b t (l d)')


INIT_ARGS = {}

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

if __name__ == '__main__':
    model = CatLayerPooler(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, 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)
Conv1dTemporalReducer Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("3414d33e85582f53")
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, Conv1dTemporalReducer: 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)

# Build a tiny input tensor with shape (B=2, T=5, C=4)
# B=batch, T=temporal/sequence, C=channels
x = torch.randn(2, 5, 4)

# subject_id is optional and not used in forward(), so None is valid
subject_id = None

ARGS = {
    "channels": 4,
    "kernel_size": 3,
    "depthwise": True,
    "bias": 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 Conv1dTemporalReducer — 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 Conv1dTemporalReducer 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
CrossAttentionInterpolationTemporalReducer Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("5d120c81ea7e2ebe")
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, CrossAttentionInterpolationTemporalReducer: 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 CrossAttentionInterpolationTemporalReducer(nn.Module):
    """Learned temporal interpolation with shared cross-attention queries."""

    def __init__(self, channels: int, *, n_output_timesteps: int, heads: int, attn_dropout: float=0.0, ff_mult: int=4) -> None:
        super().__init__()
        if channels <= 0:
            raise ValueError(f'channels must be > 0, got {channels}')
        if n_output_timesteps <= 0:
            raise ValueError(f'n_output_timesteps must be > 0, got {n_output_timesteps}')
        if heads <= 0:
            raise ValueError(f'heads must be > 0, got {heads}')
        if channels % heads != 0:
            raise ValueError(f'cross_attn_interp requires channels divisible by heads, got channels={channels} and heads={heads}.')
        if ff_mult <= 0:
            raise ValueError(f'ff_mult must be > 0, got {ff_mult}')
        self.n_output_timesteps = int(n_output_timesteps)
        self.channels = int(channels)
        self.query_tokens = nn.Parameter(torch.randn(self.n_output_timesteps, self.channels) * 0.02)
        self.input_norm = nn.LayerNorm(self.channels)
        self.query_norm = nn.LayerNorm(self.channels)
        self.attn = nn.MultiheadAttention(embed_dim=self.channels, num_heads=int(heads), dropout=float(attn_dropout), batch_first=True)
        self.dropout1 = nn.Dropout(float(attn_dropout))
        self.ff_norm = nn.LayerNorm(self.channels)
        self.ff = nn.Sequential(nn.Linear(self.channels, self.channels * int(ff_mult)), nn.GELU(), nn.Dropout(float(attn_dropout)), nn.Linear(self.channels * int(ff_mult), self.channels))
        self.dropout2 = nn.Dropout(float(attn_dropout))
        self.output_norm = nn.LayerNorm(self.channels)

    def forward(self, x: torch.Tensor, subject_id: torch.Tensor | None=None) -> torch.Tensor:
        batch_size = int(x.shape[0])
        queries = self.query_tokens.unsqueeze(0).expand(batch_size, -1, -1)
        attn_out = self.attn(self.query_norm(queries), self.input_norm(x), self.input_norm(x), need_weights=False)[0]
        hidden = queries + self.dropout1(attn_out)
        hidden = hidden + self.dropout2(self.ff(self.ff_norm(hidden)))
        return self.output_norm(hidden)


ARGS = {
    'channels': 4,
    'n_output_timesteps': 3,
    'heads': 2,
    'attn_dropout': 0.1,
    'ff_mult': 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 CrossAttentionInterpolationTemporalReducer — 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 CrossAttentionInterpolationTemporalReducer 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
GroupLinearHead Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("6c7ce4c9a7889eba")
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, GroupLinearHead: 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 GroupLinearHead.__init__
ARGS = {
    'in_channels': 4,
    'n_parcels': 3,
    'n_subjects': 2,
    'bias': 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 GroupLinearHead — 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 GroupLinearHead 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
GroupResidualSubjectHead Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("d9c415ab7e9ea01a")
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, GroupResidualSubjectHead: 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)

# Small test tensors
# x: shape (batch=2, time=3, in_channels=4)
x = torch.randn(2, 3, 4)

# subject_id: shape (batch=2,) with subject indices in range [0, n_subjects)
subject_id = torch.tensor([0, 1])

ARGS = {
    'in_channels': 4,
    'n_parcels': 5,
    'n_subjects': 2,
    'bias': 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 GroupResidualSubjectHead — 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 GroupResidualSubjectHead 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
IdentityLayerPooler Ran
ran on a synthesized input
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("c23ed0b4a693062e")
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

class IdentityLayerPooler(nn.Module):
    """Keep a single layer unchanged."""

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        if x.shape[1] != 1:
            raise ValueError(f'IdentityLayerPooler requires exactly one layer on input. Received {x.shape[1]} layers.')
        return x[:, 0, :, :]


INIT_ARGS = {}

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

if __name__ == '__main__':
    model = IdentityLayerPooler(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
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)
IdentityTemporalReducer Ran
ran on a synthesized input
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("8e4a78e884c17c97")
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, shape (2, 5, 4) 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

class IdentityTemporalReducer(nn.Module):
    """Leave the temporal axis unchanged."""

    def forward(self, x: torch.Tensor, subject_id: torch.Tensor | None=None) -> torch.Tensor:
        return x


INIT_ARGS = {}

ARGS = {
    'x': torch.randn(2, 5, 4),
    'subject_id': None
}

if __name__ == '__main__':
    model = IdentityTemporalReducer(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output matches input: {torch.equal(output, ARGS['x'])}")
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, shape (2, 5, 4) — shape (2, 5, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
LayerCrossAttentionPooler Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("07d7727d41635bef")
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, LayerCrossAttentionPooler: 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 math
from einops import rearrange

torch.manual_seed(0)

# Define ARGS dict with all parameters for LayerCrossAttentionPooler
ARGS = {
    'dim': 4,
    'heads': 2,
    'n_queries': 3,
    'query_output': 'mean',
    'attn_dropout': 0.1,
    'n_layers': None,
    'layer_pos_embedding': 'none',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LayerCrossAttentionPooler — 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 LayerCrossAttentionPooler 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
LayerSelfAttentionPooler Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("46959113073f6eaf")
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, LayerSelfAttentionPooler: 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 math

torch.manual_seed(0)

ARGS = {
    "dim": 4,
    "heads": 2,
    "n_queries": 3,
    "query_output": "mean",
    "attn_dropout": 0.1,
    "depth": 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LayerSelfAttentionPooler — 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 LayerSelfAttentionPooler 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
MeanAggregator Ran
ran on a synthesized input
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("589dcb72adc22bbd")
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 2, dtype family float, shape (2, 4) 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

class MeanAggregator(nn.Module):
    """Element-wise mean of projected modality features."""

    def forward(self, modality_features: dict[str, torch.Tensor], subject_id: torch.Tensor | None=None) -> torch.Tensor:
        tensors = list(modality_features.values())
        return torch.stack(tensors, dim=0).mean(dim=0)


INIT_ARGS = {}

ARGS = {
    "modality_features": {
        "modality_1": torch.randn(2, 4),
        "modality_2": torch.randn(2, 4),
        "modality_3": torch.randn(2, 4),
    },
    "subject_id": None,
}

if __name__ == "__main__":
    model = MeanAggregator(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MeanLayerPooler Ran
ran on a synthesized input
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("0871a59c0f7e9078")
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 2, dtype family float, shape (2, 4) 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

class MeanLayerPooler(nn.Module):
    """Average across the layer axis."""

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return x.mean(dim=1)


INIT_ARGS = {}

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

if __name__ == '__main__':
    model = MeanLayerPooler(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ModalityProjector Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("8f663cc2eb003e9b")
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, ModalityProjector: 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 = {
    'input_dim': 16,
    'output_dim': 8,
    'kind': 'linear_ln_gelu'
}
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 ModalityProjector — 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 ModalityProjector 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
ModalitySelfAttentionAggregator Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("98e4723594ac02a2")
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, ModalitySelfAttentionAggregator: 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 typing as tp

torch.manual_seed(0)

# Construct modality_features dict with small tensors
# Shape: (batch=2, time=3, embed_dim=4)
modality_features = {
    'modality_1': torch.randn(2, 3, 4),
    'modality_2': torch.randn(2, 3, 4),
    'modality_3': torch.randn(2, 3, 4),
}

# Optional subject_id tensor
subject_id = torch.tensor([0, 1])

# Define ARGS dict with all __init__ parameters
ARGS = {
    'embed_dim': 4,
    'heads': 2,
    'attn_dropout': 0.1,
    'output': 'cat',
}
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 ModalitySelfAttentionAggregator — 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 ModalitySelfAttentionAggregator 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
SubjectLinearHead Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("d801121550a0a6de")
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, SubjectLinearHead: 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)

# Parameters for SubjectLinearHead.__init__
in_channels = 4
n_parcels = 3
n_subjects = 2
bias = True

# Create the model instance
model = nn.Module()

# Now create arguments for the forward method
batch_size = 2
seq_length = 5

# x: (B, T, D) latent features
x = torch.randn(batch_size, seq_length, in_channels)

# subject_id: (B,) long tensor of subject indices
subject_id = torch.tensor([0, 1], dtype=torch.long)

# prediction_mode: str | None
prediction_mode = None

ARGS = {
    'in_channels': in_channels,
    'n_parcels': n_parcels,
    'n_subjects': n_subjects,
    'bias': bias,
}
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 SubjectLinearHead — 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 SubjectLinearHead 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
SubjectQueryCrossAttentionHead Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("54fb7b4f0a85e894")
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, SubjectQueryCrossAttentionHead: 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)

# Small stand-in input tensor: (batch_size=2, seq_len=5, in_channels=4)
x = torch.randn(2, 5, 4)

# Subject IDs tensor: (batch_size=2,) with values in range [0, n_subjects)
subject_id = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    'in_channels': 4,
    'n_parcels': 3,
    'n_subjects': 2,
    'n_queries': 2,
    'heads': 2,
    'attn_dropout': 0.1,
    'ff_mult': 4,
    'bias': True,
    'ff_enabled': 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 SubjectQueryCrossAttentionHead — 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 SubjectQueryCrossAttentionHead 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
SubjectShiftedCrossAttentionInterpolationTemporalReducer Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("48903652439efad2")
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, SubjectShiftedCrossAttentionInterpolationTemporalReducer: 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 the arguments for SubjectShiftedCrossAttentionInterpolationTemporalReducer
ARGS = {
    'channels': 8,
    'n_output_timesteps': 4,
    'n_subjects': 3,
    'heads': 2,
    'attn_dropout': 0.1,
    'ff_mult': 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 SubjectShiftedCrossAttentionInterpolationTemporalReducer — 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 SubjectShiftedCrossAttentionInterpolationTemporalReducer 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
SumAggregator Ran
ran on a synthesized input
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("2de834c277ce11ad")
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 2, dtype family float, shape (2, 4) 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

class SumAggregator(nn.Module):
    """Element-wise sum of projected modality features."""

    def forward(self, modality_features: dict[str, torch.Tensor], subject_id: torch.Tensor | None=None) -> torch.Tensor:
        tensors = list(modality_features.values())
        out = tensors[0]
        for t in tensors[1:]:
            out = out + t
        return out


INIT_ARGS = {}

ARGS = {
    "modality_features": {
        "modality_1": torch.randn(2, 4),
        "modality_2": torch.randn(2, 4),
        "modality_3": torch.randn(2, 4),
    },
    "subject_id": None,
}

if __name__ == "__main__":
    model = SumAggregator(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TemporalEncoder Ran
ran on a synthesized input
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("c487ea3382c73e4e")
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

# Mock x_transformers.Encoder since it may not be available
class MockEncoder(nn.Module):
    def __init__(self, dim, depth, heads, attn_dim_head, ff_mult, attn_dropout, ff_dropout, layer_dropout, use_scalenorm, rotary_pos_emb, scale_residual):
        super().__init__()
        self.dim = dim
        self.depth = depth
        self.heads = heads
        self.layers = nn.ModuleList([
            nn.TransformerEncoderLayer(
                d_model=dim,
                nhead=heads,
                dim_feedforward=dim * ff_mult,
                dropout=ff_dropout,
                batch_first=True,
                activation='relu'
            )
            for _ in range(depth)
        ])
    
    def forward(self, x):
        for layer in self.layers:
            x = layer(x)
        return x

# Patch x_transformers before importing TemporalEncoder
import sys
from types import ModuleType
x_transformers = ModuleType('x_transformers')
x_transformers.Encoder = MockEncoder
sys.modules['x_transformers'] = x_transformers

class TemporalEncoder(nn.Module):
    """Transformer encoder with learned time positional embeddings.

    Parameters
    ----------
    hidden_dim:
        Dimensionality of input and output tokens (must equal the aggregator
        output dim).
    depth:
        Number of transformer layers.
    heads:
        Number of attention heads.
    ff_mult:
        Feed-forward expansion factor.
    attn_dropout:
        Dropout in attention weights.
    ff_dropout:
        Dropout in feed-forward layers.
    layer_dropout:
        Stochastic depth rate.
    max_time_len:
        Maximum number of time steps (used to size the learned positional
        embedding table).
    n_subjects:
        If > 0 and ``subject_embedding=True``, a per-subject bias is added to
        the positional embedding.
    subject_embedding:
        Whether to add a subject-specific token to each position.
    """

    def __init__(self, hidden_dim: int=3072, depth: int=8, heads: int=8, ff_mult: int=4, attn_dropout: float=0.0, ff_dropout: float=0.0, layer_dropout: float=0.0, max_time_len: int=1024, n_subjects: int=0, subject_embedding: bool=False) -> None:
        super().__init__()
        from x_transformers import Encoder
        self.time_pos_embed = nn.Parameter(torch.randn(1, max_time_len, hidden_dim))
        if subject_embedding and n_subjects > 0:
            self.subject_embed = nn.Embedding(n_subjects, hidden_dim)
        else:
            self.subject_embed = None
        self.encoder = Encoder(dim=hidden_dim, depth=depth, heads=heads, attn_dim_head=hidden_dim // heads, ff_mult=ff_mult, attn_dropout=attn_dropout, ff_dropout=ff_dropout, layer_dropout=layer_dropout, use_scalenorm=True, rotary_pos_emb=True, scale_residual=True)

    def forward(self, x: torch.Tensor, subject_id: torch.Tensor | None=None) -> torch.Tensor:
        """
        Parameters
        ----------
        x:
            (B, T, D) aggregated feature tensor.
        subject_id:
            (B,) long tensor of subject indices.

        Returns
        -------
        (B, T, D) contextualised representations.
        """
        T = x.size(1)
        x = x + self.time_pos_embed[:, :T]
        if self.subject_embed is not None and subject_id is not None:
            x = x + self.subject_embed(subject_id).unsqueeze(1)
        return self.encoder(x)


INIT_ARGS = {
    'hidden_dim': 64,
    'depth': 2,
    'heads': 4,
    'ff_mult': 2,
    'attn_dropout': 0.0,
    'ff_dropout': 0.0,
    'layer_dropout': 0.0,
    'max_time_len': 16,
    'n_subjects': 3,
    'subject_embedding': True,
}

ARGS = {
    'x': torch.randn(2, 5, 64),
    'subject_id': torch.tensor([0, 1], dtype=torch.long),
}

if __name__ == '__main__':
    model = TemporalEncoder(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, 5, 64)")
    assert output.shape == (2, 5, 64), f"Shape mismatch: {output.shape}"
    print("Test passed!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch, x_transformers — 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)
_AttentionPoolerBase Ran
ran on a synthesized input · constructed an object; no result was computed
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("f29f6a59819301c0")
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, _AttentionPoolerBase: 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 math

torch.manual_seed(0)

ARGS = {
    'dim': 4,
    'n_queries': 3,
    'query_output': 'mean',
    'learned_queries': True,
    'n_layers': 5,
    'layer_pos_embedding': 'sinusoidal',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _AttentionPoolerBase — 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 _AttentionPoolerBase 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
_default_modality_stack Ran
ran; our contract draft was wrong, not the code
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("fd815bbbe0638c96")
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 dict. 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 typing as tp

torch.manual_seed(0)

# The function takes two string parameters: fusion_kind and layer_pooler_kind
# It simply constructs a dictionary with these values, no complex operations
# So we just need valid string values

ARGS = {
    'fusion_kind': 'concatenation',
    'layer_pooler_kind': 'mean',
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
_default_readout_config Ran
ran; our contract draft was wrong, not the code
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("26f82874b21db6a3")
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 dict. 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 typing as tp

torch.manual_seed(0)

ARGS = {
    'fmri_head': 'linear',
    'n_output_timesteps': 8,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
_normalize_prediction_mode Ran
ran; our contract draft was wrong, not the code
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("a7c78a3335d0882f")
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 str. 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

torch.manual_seed(0)

# The function _normalize_prediction_mode takes a single parameter:
# - prediction_mode: str | None

# The function:
# 1. Sets mode to 'default' if prediction_mode is None, else converts to string and strips/lowercases
# 2. Returns 'full' if mode is in {'default', 'full'}
# 3. Returns mode if mode == 'group_only'
# 4. Raises ValueError otherwise

# Valid test cases:
# - None (converts to 'default', returns 'full')
# - 'default' (returns 'full')
# - 'full' (returns 'full')
# - 'group_only' (returns 'group_only')
# - 'DEFAULT' (strips/lowers to 'default', returns 'full')
# - '  full  ' (strips/lowers to 'full', returns 'full')

# We'll test with a valid input
ARGS = {
    'prediction_mode': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
_normalize_readout_config Ran
ran; our contract draft was wrong, not the code
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("ca89046d37f804f1")
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 dict. 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 typing as tp

torch_seed = 0

# Analyze the function: _normalize_readout_config takes:
# 1. readout_config: dict[str, tp.Any] | None
# 2. fmri_head: str
# 3. n_output_timesteps: int

# The function:
# - Creates a default config with 'head' and 'temporal_reducer' keys
# - If readout_config is not None, merges it into cfg
# - For dict values, it performs a nested merge
# - Otherwise it overwrites the value

# Build test arguments
readout_config_test = {
    'head': {'kind': 'custom_head'},
    'temporal_reducer': {'location': 'pre_head'}
}

fmri_head_test = 'linear'
n_output_timesteps_test = 16

ARGS = {
    'readout_config': readout_config_test,
    'fmri_head': fmri_head_test,
    'n_output_timesteps': n_output_timesteps_test
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
_pooler_defaults Ran
ran; our contract draft was wrong, not the code
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("ff62e0d0e2158711")
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 dict. 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 typing as tp

torch.manual_seed(0)

ARGS = {
    'config': {
        'kind': 'cat',
        'heads': 8,
        'n_queries': 2,
        'query_output': 'concat',
        'attn_dropout': 0.1,
        'depth': 2,
        'layer_pos_embedding': 'none'
    }
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
_sinusoidal_layer_positions Ran
ran, honoured the contract we drafted
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("d695096a137fe8f8")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 math

torch.manual_seed(0)

ARGS = {
    "n_layers": 2,
    "dim": 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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
build_aggregator Ran
ran; our contract draft was wrong, not the code
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("b8f600dd1667fb31")
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 ModalitySelfAttentionAggregator. 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)

# Test with 'self_attn_cat' mode which requires embed_dim
ARGS = {
    'mode': 'self_attn_cat',
    'embed_dim': 8,
    'heads': 2,
    'attn_dropout': 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 ModalitySelfAttentionAggregator — a ModalitySelfAttentionAggregator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModalitySelfAttentionAggregator 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_projectors Ran
ran; our contract draft was wrong, not the code
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("d0c13de0a2974a31")
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 ModuleDict. 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 mapping every parameter of build_projectors
ARGS = {
    "feature_dims": {
        "vision": (2, 4),      # 2 layers, 4-dim features
        "audio": (3, 5),       # 3 layers, 5-dim features
        "text": None,          # absent modality
    },
    "hidden_dim": 16,
    "feature_aggregation": "cat",
    "projector_kind": "linear_ln_gelu",
}
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 ModuleDict — a ModuleDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleDict output the recorded ndim 1 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
layer_pooler_output_dim Ran
ran, honoured the contract we drafted
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("438ff1b11da853b4")
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 int, ndim 0, dtype family int, shape () 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 typing as tp

torch.manual_seed(0)

# Test case 1: kind='cat'
ARGS_1 = {
    'n_layers': 3,
    'n_dim': 5,
    'config': {'kind': 'cat'}
}

# Test case 2: kind='identity'
ARGS_2 = {
    'n_layers': 2,
    'n_dim': 8,
    'config': {'kind': 'identity'}
}

# Test case 3: kind='mean'
ARGS_3 = {
    'n_layers': 4,
    'n_dim': 6,
    'config': {'kind': 'mean'}
}

# Test case 4: kind='layer_cross_attn' with query_output='concat'
ARGS_4 = {
    'n_layers': 2,
    'n_dim': 7,
    'config': {
        'kind': 'layer_cross_attn',
        'query_output': 'concat',
        'n_queries': 3
    }
}

# Test case 5: kind='layer_self_attn' with query_output='mean'
ARGS_5 = {
    'n_layers': 3,
    'n_dim': 10,
    'config': {
        'kind': 'layer_self_attn',
        'query_output': 'mean',
        'n_queries': 2
    }
}

# Test case 6: config=None (should use defaults)
ARGS_6 = {
    'n_layers': 5,
    'n_dim': 4,
    'config': None
}

ARGS = ARGS_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 int, ndim 0, dtype family int, shape () — shape () 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
BaseBrainEncoder Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("261520210e7da4fc")
How it ran

no invocation recorded.

LowRankSubjectHead Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("984d63bcdb6a0c9a")
How it ran

no invocation recorded.

ParcelMLPHead Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("71623edf16f081b4")
How it ran

no invocation recorded.

SigmoidGateAggregator Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("131ce27c65253bdb")
How it ran

no invocation recorded.

SoftmaxGateAggregator Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("65cb79b3f988860a")
How it ran

no invocation recorded.

SubjectConditionedGateAggregator Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("10afe4e4b801a9f1")
How it ran

no invocation recorded.

SubjectTokenConditionedGroupHead Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("fd925ab8a603ee17")
How it ran

no invocation recorded.

SubjectTokenConditionedHead Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("6acc2bc4c5925703")
How it ran

no invocation recorded.

build_head Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("63dea3514ef83a16")
How it ran

no invocation recorded.

build_layer_pooler Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("f63759d7f9a21827")
How it ran

no invocation recorded.

build_temporal_reducer Not yet run
unverified (harvested, no recorded run)
epflneuroailab/mirage/src/brain_enc/models/base_brain_encoder.py
code served (permissive licence) · get_code("50b83917247cf1ff")
How it ran

no invocation recorded.

Also present in other papers' code

Of 41 samples lifted from this paper's linked repositories, 41 carry a function identity and 0 do not. Of the 41 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 41 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-24.

Repositories linked to this paper

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

Abstract

Recent progress in task-optimized neural networks has established encoding models as a powerful tool for predicting brain responses to naturalistic stimuli, yet most existing approaches rely on unimodal representations. The emergence of omni-modal foundation models and rich multimodal neural datasets enables encoding models that jointly integrate visual, auditory, and linguistic information across subjects. We introduce MIRAGE, a brain encoding framework for predicting whole-brain fMRI responses to naturalistic audiovisual stimuli. MIRAGE achieves state-of-the-art performance via a native multimodal backbone and adaptive feature gating across layers. These representations are then combined with a transformer-based brain encoder and a subject-specific linear head over the cortical parcels. Controlled comparisons show that natively multimodal features consistently outperform post-hoc aggregation of independent unimodal features, across architectural levels and backbones. Beyond predictive accuracy, the learned attention weights are directly inspectable to interpret the modality-specific gating profile over the backbone, and each modality traces a distinct anatomical pattern across cortex. Together, these results propose adaptive layer-wise aggregation of natively multimodal features as a generalizable, interpretable, and accurate approach for whole-brain encoding.

For agents

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

get_harvested_code_for_paper("2605.29850")
get_code_for_paper("2605.29850")
have("2605.29850")

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

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

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

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

Connect an agent — have() is free.