SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.15350 · AAAI · 2022

End-to-End Transformer Based Model for Image Captioning

Yingfei Sun, Yiyu Wang, Jungang Xu

arXiv · PDF · Open in the Atlas

Code that ran

17 of 33 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (9 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 2 violated it and 11 have no contract verdict; 3 failures of our instrument; 16 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/2203.15350.json · badge: /api/ran/2203.15350.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
jchenghu/expansionnet_v2 community
Papers with Code archive
9 ran · 9 no recorded run
232525/PureT marked official in Papers with Code
Papers with Code archive
8 ran · 7 no recorded run
FunctionStatusWhere it lives
DecoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("1ba18af6ffb51016")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

DropPath Ran
ran on a synthesized input · constructed an object; no result was computed
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("d14d5773d2c8e320")
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, DropPath: 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 = {
    "drop_prob": 0.5
}
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 DropPath — 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 DropPath 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
EmbeddingLayer Ran
ran on a synthesized input · constructed an object; no result was computed
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("8dc0059690e3667f")
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, EmbeddingLayer: 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 = {
    "vocab_size": 100,
    "d_model": 64,
    "dropout_perc": 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 EmbeddingLayer — 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 EmbeddingLayer 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
EncoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("fafb495b474a7acd")
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, EncoderLayer: 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 EncoderLayer
d_model = 4
d_ff = 8
num_enc_exp_list = [2, 3]  # Two expansion groups with 2 and 3 expansions respectively
dropout_perc = 0.1
eps = 1e-9

ARGS = {
    'd_model': d_model,
    'd_ff': d_ff,
    'num_enc_exp_list': num_enc_exp_list,
    'dropout_perc': dropout_perc,
    'eps': eps,
}
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 EncoderLayer — 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 EncoderLayer 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
FeedForward Ran
ran on a synthesized input · constructed an object; no result was computed
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("47ef05333de71076")
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, FeedForward: 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 FeedForward module as shown
class FeedForward(nn.Module):

    def __init__(self, d_model, d_ff, dropout_perc):
        super(FeedForward, self).__init__()
        self.linear_1 = nn.Linear(d_model, d_ff)
        self.dropout = nn.Dropout(dropout_perc)
        self.linear_2 = nn.Linear(d_ff, d_model)

    def forward(self, x):
        x = self.dropout(torch.nn.functional.relu(self.linear_1(x)))
        x = self.linear_2(x)
        return x


# Create arguments for FeedForward.__init__
ARGS = {
    'd_model': 4,
    'd_ff': 8,
    'dropout_perc': 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 FeedForward — 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 FeedForward 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
FeedForward Ran
ran on a synthesized input · constructed an object; no result was computed
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("2b5d0b9e88a90691")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

MultiHeadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("ac6767df3a332ab9")
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, MultiHeadAttention: 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 torch.nn.functional as F

class MultiHeadAttention(nn.Module):

    def __init__(self, d_model, num_heads, dropout_perc):
        super(MultiHeadAttention, self).__init__()
        assert d_model % num_heads == 0, 'num heads must be multiple of d_model'
        self.d_model = d_model
        self.d_k = int(d_model / num_heads)
        self.num_heads = num_heads
        self.Wq = nn.Linear(d_model, self.d_k * num_heads)
        self.Wk = nn.Linear(d_model, self.d_k * num_heads)
        self.Wv = nn.Linear(d_model, self.d_k * num_heads)
        self.out_linear = nn.Linear(d_model, d_model)

    def forward(self, q, k, v, mask=None):
        batch_size, q_seq_len, _ = q.shape
        k_seq_len = k.size(1)
        v_seq_len = v.size(1)
        k_proj = self.Wk(k).view(batch_size, k_seq_len, self.num_heads, self.d_k)
        q_proj = self.Wq(q).view(batch_size, q_seq_len, self.num_heads, self.d_k)
        v_proj = self.Wv(v).view(batch_size, v_seq_len, self.num_heads, self.d_k)
        k_proj = k_proj.transpose(2, 1)
        q_proj = q_proj.transpose(2, 1)
        v_proj = v_proj.transpose(2, 1)
        sim_scores = torch.matmul(q_proj, k_proj.transpose(3, 2))
        sim_scores = sim_scores / self.d_k ** 0.5
        if mask is not None:
            mask = mask.unsqueeze(1).repeat(1, self.num_heads, 1, 1)
            sim_scores = sim_scores.masked_fill(mask == 0, value=-10000.0)
        sim_scores = F.softmax(input=sim_scores, dim=-1)
        attention_applied = torch.matmul(sim_scores, v_proj)
        attention_applied_concatenated = attention_applied.permute(0, 2, 1, 3).contiguous().view(batch_size, q_seq_len, self.d_model)
        out = self.out_linear(attention_applied_concatenated)
        return out

torch.manual_seed(0)

d_model = 8
num_heads = 2
dropout_perc = 0.1

mha = MultiHeadAttention(d_model=d_model, num_heads=num_heads, dropout_perc=dropout_perc)

batch_size = 2
q_seq_len = 3
k_seq_len = 5
v_seq_len = 5

q = torch.randn(batch_size, q_seq_len, d_model)
k = torch.randn(batch_size, k_seq_len, d_model)
v = torch.randn(batch_size, v_seq_len, d_model)
mask = torch.ones(batch_size, 1, q_seq_len, k_seq_len)

ARGS = {
    'd_model': d_model,
    'num_heads': num_heads,
    'dropout_perc': dropout_perc,
}
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 MultiHeadAttention — 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 MultiHeadAttention 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
MultiHeadSelfAttention Ran
ran on a synthesized input
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("1b4e47ec99e1e927")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

PatchEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("4e15874ef9b1a7e7")
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, PatchEmbed: 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 a minimal norm layer that will be used
norm_layer = nn.LayerNorm

# Create the ARGS dictionary with all parameters for PatchEmbed
ARGS = {
    "img_size": 224,
    "patch_size": 4,
    "in_chans": 3,
    "embed_dim": 96,
    "norm_layer": norm_layer,
}
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 PatchEmbed — 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 PatchEmbed 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
StaticExpansionBlock Ran
ran on a synthesized input
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("44e7ad9330aa17b8")
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

INIT_ARGS = {
    'd_model': 4,
    'num_enc_exp_list': [2, 3],
    'dropout_perc': 0.1,
    'eps': 1e-6,
}

ARGS = {
    'x': torch.randn(2, 5, 4),
    'n_indexes': torch.tensor([0, 1, 2, 3, 4]),
    'mask': torch.ones(2, 5, 5),
}

if __name__ == '__main__':
    from torch import nn
    import torch.nn.functional as F

    class StaticExpansionBlock(nn.Module):

        def __init__(self, d_model, num_enc_exp_list, dropout_perc, eps):
            super().__init__()
            self.d_model = d_model
            self.num_enc_exp_list = num_enc_exp_list
            self.query_exp_vectors = nn.Embedding(sum(num_enc_exp_list), d_model)
            self.bias_exp_vectors = nn.Embedding(sum(num_enc_exp_list), d_model)
            self.key_embed = nn.Linear(d_model, d_model)
            self.class_a_embed = nn.Linear(d_model, d_model)
            self.class_b_embed = nn.Linear(d_model, d_model)
            self.selector_embed = nn.Linear(d_model, d_model)
            self.dropout_class_a_fw = nn.Dropout(dropout_perc)
            self.dropout_class_b_fw = nn.Dropout(dropout_perc)
            self.dropout_class_a_bw = nn.Dropout(dropout_perc)
            self.dropout_class_b_bw = nn.Dropout(dropout_perc)
            self.Z_dropout = nn.Dropout(dropout_perc)
            self.eps = eps

        def forward(self, x, n_indexes, mask):
            bs, enc_len, _ = x.shape
            query_exp = self.query_exp_vectors(n_indexes)
            bias_exp = self.bias_exp_vectors(n_indexes)
            x_key = self.key_embed(x)
            z = torch.matmul(query_exp, x_key.transpose(-1, -2)) / self.d_model ** 0.5
            z = self.Z_dropout(z)
            class_a_fw = F.relu(z)
            class_b_fw = F.relu(-z)
            class_a_fw = class_a_fw.masked_fill(mask == 0, 0.0)
            class_b_fw = class_b_fw.masked_fill(mask == 0, 0.0)
            class_a_fw = class_a_fw / (class_a_fw.sum(dim=-1, keepdim=True) + self.eps)
            class_b_fw = class_b_fw / (class_b_fw.sum(dim=-1, keepdim=True) + self.eps)
            class_a = torch.matmul(class_a_fw, self.class_a_embed(x)) + bias_exp
            class_b = torch.matmul(class_b_fw, self.class_b_embed(x)) + bias_exp
            class_a = self.dropout_class_a_fw(class_a)
            class_b = self.dropout_class_b_fw(class_b)
            class_a_bw = F.relu(z.transpose(-2, -1))
            class_b_bw = F.relu(-z.transpose(-2, -1))
            accum = 0
            class_a_bw_list = []
            class_b_bw_list = []
            for j in range(len(self.num_enc_exp_list)):
                from_idx = accum
                to_idx = accum + self.num_enc_exp_list[j]
                accum += self.num_enc_exp_list[j]
                class_a_bw_list.append(class_a_bw[:, :, from_idx:to_idx] / (class_a_bw[:, :, from_idx:to_idx].sum(dim=-1, keepdim=True) + self.eps))
                class_b_bw_list.append(class_b_bw[:, :, from_idx:to_idx] / (class_b_bw[:, :, from_idx:to_idx].sum(dim=-1, keepdim=True) + self.eps))
            class_a_bw = torch.cat(class_a_bw_list, dim=-1)
            class_b_bw = torch.cat(class_b_bw_list, dim=-1)
            class_a = torch.matmul(class_a_bw, class_a) / len(self.num_enc_exp_list)
            class_b = torch.matmul(class_b_bw, class_b) / len(self.num_enc_exp_list)
            class_a = self.dropout_class_a_bw(class_a)
            class_b = self.dropout_class_b_bw(class_b)
            selector = torch.sigmoid(self.selector_embed(x))
            x_result = selector * class_a + (1 - selector) * class_b
            return x_result

    model = StaticExpansionBlock(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"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 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)
WindowAttention Ran
ran on a synthesized input · constructed an object; no result was computed
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("5fd5f10dcdb2c664")
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, WindowAttention: 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 = {
    "dim": 8,
    "window_size": (2, 2),
    "num_heads": 2,
    "qkv_bias": True,
    "qk_scale": None,
    "attn_drop": 0.0,
    "proj_drop": 0.0,
}
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 WindowAttention — 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 WindowAttention 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
activation Ran
ran; our contract draft was wrong, not the code
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("a7b560d30ae66959")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

expand_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("84c9e795607ff8d1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

position_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("e344c95038ed76fd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

sinusoid_encoding_table Ran
ran, honoured the contract we drafted
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("35fbc756acf92321")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

subsequent_mask Ran
ran, violated the contract we drafted
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("d52f2d9e7e545563")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

to_2tuple Ran
ran, violated the contract we drafted
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("905129493d469a67")
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 list, ndim 1, dtype family int; 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 collections.abc
import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "x": [1, 2]
}
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 list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
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
BasicLayer Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("57addd57b713784d")
How it ran

no invocation recorded.

BasicLayer Not yet run
unverified (harvested, no recorded run)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("a383a407c29985a1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

BasicModel Not yet run
unverified (harvested, no recorded run)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("5b2d8e2e4e7f8a89")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

CaptioningModel Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("7e1f0615f9be6815")
How it ran

no invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("08f74e27081d74e9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

DecoderLayer Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("3bafaef1eb838048")
How it ran

no invocation recorded.

DynamicExpansionBlock Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("b525d13f285adc10")
How it ran

no invocation recorded.

Encoder Not yet run
unverified (harvested, no recorded run)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("67c9f8c281deae2e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

EncoderLayer Not yet run
unverified (harvested, no recorded run)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("0fd3949590683cc4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

End_ExpansionNet_v2 Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("9cf97124f3e0546a")
How it ran

no invocation recorded.

PureT Not yet run
unverified (harvested, no recorded run)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("cbce59c76431bd39")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

SwinTransformer Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("d4ca4e9d197b7459")
How it ran

no invocation recorded.

SwinTransformerBlock Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("2b3a7a150945b433")
How it ran

no invocation recorded.

SwinTransformerBlock Not yet run
unverified (harvested, no recorded run)
232525/PureT/models/pure_transformer.py
pointer only (licence: NONE) · get_code("284c0f72a6c81f95")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, 232525/PureT when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

create_no_peak_and_pad_mask Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("f20981676e57f873")
How it ran

no invocation recorded.

create_pad_mask Not yet run
unverified (harvested, no recorded run)
jchenghu/expansionnet_v2/models/End_ExpansionNet_v2.py
code served (permissive licence) · get_code("bb0dd55c83a9c845")
How it ran

no invocation recorded.

Also present in other papers' code

Of 33 samples lifted from this paper's linked repositories, 33 carry a function identity and 0 do not. Of the 31 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 1 the same month, 7 later) and 24 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
WindowAttention
brick of this paper's assembly: model
15 other papers
2 dated earlier, 1 the same month, 12 later · 5 only as an assembly brick
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2108.10257 (2021-08)
SwinIR: Image Restoration Using Swin Transformer
2203.13963 (2022-03)
Transformer-empowered Multi-scale Contextual Matching and Aggregation for Multi-contrast MRI Super-resolution
and 12 more not named here
PatchEmbed
brick of this paper's assembly: helper, model
9 other papers
1 dated earlier, 8 later · 5 only as an assembly brick
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2204.03610 (2022-04)
Unified Contrastive Learning in Image-Text-Label Space
2204.07154 (2022-04)
MiniViT: Compressing Vision Transformers with Weight Multiplexing
and 6 more not named here
BasicLayer
brick of this paper's assembly: helper
7 other papers
1 dated earlier, 6 later · 2 only as an assembly brick
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2204.03610 (2022-04)
Unified Contrastive Learning in Image-Text-Label Space
2204.09222 (2022-04)
K-LITE: Learning Transferable Visual Models with External Knowledge
and 4 more not named here
SwinTransformerBlock
brick of this paper's assembly: helper
7 other papers
1 dated earlier, 6 later · 2 only as an assembly brick
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2204.03610 (2022-04)
Unified Contrastive Learning in Image-Text-Label Space
2204.09222 (2022-04)
K-LITE: Learning Transferable Visual Models with External Knowledge
and 4 more not named here
position_embedding
brick of this paper's assembly: helper
3 other papers
1 dated earlier, 1 later, 1 same year, order not determinable
1912.08226 (2019-12)
Meshed-Memory Transformer for Image Captioning
ijcai2022_0224 (2022 (year only))
S 2 Transformer for Image Captioning
2310.18773 (2023-10)
CityRefer: Geography-aware 3D Visual Grounding Dataset on City-scale Point Cloud Data
sinusoid_encoding_table
brick of this paper's assembly: helper
3 other papers
1 dated earlier, 1 later, 1 same year, order not determinable
1912.08226 (2019-12)
Meshed-Memory Transformer for Image Captioning
ijcai2022_0224 (2022 (year only))
S 2 Transformer for Image Captioning
2310.18773 (2023-10)
CityRefer: Geography-aware 3D Visual Grounding Dataset on City-scale Point Cloud Data
to_2tuple
brick of this paper's assembly: helper
3 other papers
2 dated earlier, 1 later
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2404.10710 (2024-04)
Autoregressive Pre-Training on Pixels and Texts

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

CNN-LSTM based architectures have played an important role in image captioning, but limited by the training efficiency and expression ability, researchers began to explore the CNN-Transformer based models and achieved great success. Meanwhile, almost all recent works adopt Faster R-CNN as the backbone encoder to extract region-level features from given images. However, Faster R-CNN needs a pre-training on an additional dataset, which divides the image captioning task into two stages and limits its potential applications. In this paper, we build a pure Transformer-based model, which integrates image captioning into one stage and realizes end-to-end training. Firstly, we adopt SwinTransformer to replace Faster R-CNN as the backbone encoder to extract grid-level features from given images; Then, referring to Transformer, we build a refining encoder and a decoder. The refining encoder refines the grid features by capturing the intra-relationship between them, and the decoder decodes the refined features into captions word by word. Furthermore, in order to increase the interaction between multi-modal (vision and language) features to enhance the modeling capability, we calculate the mean pooling of grid features as the global feature, then introduce it into refining encoder to refine with grid features together, and add a pre-fusion process of refined global feature and generated words in decoder. To validate the effectiveness of our proposed model, we conduct experiments on MSCOCO dataset. The experimental results compared to existing published works demonstrate that our model achieves new state-of-the-art performances of 138.2% (single model) and 141.0% (ensemble of 4 models) CIDEr scores on 'Karpathy' offline test split and 136.0% (c5) and 138.3% (c40) CIDEr scores on the official online test server. Trained models and source code will be released.

For agents

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

get_harvested_code_for_paper("2203.15350")
get_code_for_paper("2203.15350")
have("2203.15350")

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

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

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

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

Connect an agent — have() is free.