SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.09623 · 2020

Learning Visual Commonsense for Robust Scene Graph Generation

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-21; 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/2006.09623.json · badge: /api/ran/2006.09623.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
ZhecanJamesWang/GLAT_SGG community (classifier label)
classifier basis not recorded on the link
9 ran · 2 no recorded run
FunctionStatusWhere it lives
filter_dets Ran
ran; our contract draft was wrong, not the code
ZhecanJamesWang/GLAT_SGG/lib/surgery.py
code served (permissive licence) · get_code("6c8dc09d0a783306")
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 tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# num_box = 2
# num_rel = 3
# num_predicates = 5

boxes = torch.tensor([
    [10.0, 20.0, 30.0, 40.0],
    [50.0, 60.0, 70.0, 80.0]
], dtype=torch.float32)

obj_scores = torch.tensor([0.9, 0.8], dtype=torch.float32)

obj_classes = torch.tensor([1, 2], dtype=torch.long)

rel_inds = torch.tensor([
    [0, 1],
    [1, 0],
    [0, 0]
], dtype=torch.long)

pred_scores = torch.rand(3, 5, dtype=torch.float32)

ARGS = {
    'boxes': boxes,
    'obj_scores': obj_scores,
    'obj_classes': obj_classes,
    'rel_inds': rel_inds,
    'pred_scores': pred_scores
}
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 tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_attn_key_pad_mask Ran
ran on a synthesized input
ZhecanJamesWang/GLAT_SGG/lib/models_kern.py
code served (permissive licence) · get_code("6f18f207a73aa64a")
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 3, dtype family float, shape (2, 4, 5) 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
from torch.autograd import Variable

torch.manual_seed(0)

# seq_q is used for: seq_q.size(1) to get len_q
# It should be a tensor with at least 2 dimensions
# Batch size 2, sequence length 4, some feature dimension
seq_q = torch.randn(2, 4, 3)

# node_type is used for: node_type == 2 (comparison)
# and .unsqueeze(1).expand(-1, len_q, -1)
# So it should be a tensor that can be compared to 2
# Shape should be (batch, node_dim) where node_dim differs from seq length
node_type = torch.tensor([[1, 2, 1, 2, 3], [2, 1, 2, 1, 2]], dtype=torch.long)

ARGS = {
    'seq_q': seq_q,
    'node_type': node_type,
}
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 3, dtype family float, shape (2, 4, 5) — shape (2, 4, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_non_pad_mask Ran
ran on a synthesized input
ZhecanJamesWang/GLAT_SGG/lib/models_kern.py
code served (permissive licence) · get_code("390a257a821b762d")
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 3, dtype family float, shape (2, 4, 1) 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
from torch.autograd import Variable

torch.manual_seed(0)

# seq: a 2D tensor (batch_size, sequence_length or feature_dim)
seq = torch.randint(0, 5, (2, 4)).float()

# node_type: a tensor that will be compared with 2
# Should have same shape as seq or be broadcastable
node_type = torch.tensor([[0, 1, 2, 3], [1, 2, 0, 1]])

ARGS = {
    "seq": seq,
    "node_type": node_type
}
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 3, dtype family float, shape (2, 4, 1) — shape (2, 4, 1) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_ranking Ran
ran; our contract draft was wrong, not the code
ZhecanJamesWang/GLAT_SGG/lib/pytorch_misc.py
pointer only (licence: MIT); the stored copy get_code serves, from declare-lab/lg-vqa, is pointer only (licence: NONE) · get_code("a1e587129dd2dfaf")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from declare-lab/lg-vqa, and GitHub detected no licence in that repository 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.

optimistic_restore Ran
ran on a synthesized input
ZhecanJamesWang/GLAT_SGG/lib/pytorch_misc.py
code served (permissive licence) · get_code("6d0daf87a6ec7e39")
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 bool, ndim 0, dtype family float, 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 torch.nn as nn

torch.manual_seed(0)

# Create a simple neural network
class SimpleNetwork(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Create network instance
network = SimpleNetwork()

# Create a state dict that will be partially compatible
# Include some matching keys, one unexpected key, and one missing key
state_dict = {
    'linear1.weight': torch.randn(3, 4),  # matches network's linear1.weight size
    'linear1.bias': torch.randn(3),       # matches network's linear1.bias size
    'linear2.weight': torch.randn(2, 3),  # matches network's linear2.weight size
    'linear2.bias': torch.randn(2),       # matches network's linear2.bias size
    'unexpected_key': torch.randn(5, 5),  # unexpected key not in network
}

# The network has: linear1.weight, linear1.bias, linear2.weight, linear2.bias
# The state_dict has all of those plus 'unexpected_key'
# This means linear2.weight and linear2.bias will be missing from the "missing" set
# and 'unexpected_key' will trigger the mismatch

ARGS = {
    'network': network,
    'state_dict': state_dict
}
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 bool, ndim 0, dtype family float, 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
pairwise Ran
ran; our contract draft was wrong, not the code
ZhecanJamesWang/GLAT_SGG/lib/pytorch_misc.py
code served (permissive licence) · get_code("fef49730c9e9a2b8")
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 zip. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from itertools import tee

torch.manual_seed(0)

# The pairwise function takes an iterable and returns consecutive pairs
# It uses: tee() to create independent iterators, next() to advance one, and zip() to pair them
# The iterable parameter just needs to be any iterable object

# Create a simple iterable - a list of distinct values
iterable_input = [1, 2, 3, 4, 5]

ARGS = {
    "iterable": iterable_input
}
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 zip — a zip output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a zip 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
path Ran
ran; our contract draft was wrong, not the code
ZhecanJamesWang/GLAT_SGG/config.py
code served (permissive licence) · get_code("a2fca8a84cec8b3f")
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 os

DATA_PATH = '/kiwi-data/projects/commonsense/shared/alireza_repo/metadata/VG/stanford/'

def path(fn):
    return os.path.join(DATA_PATH, fn)

# The function takes a single parameter 'fn' which is a filename string
# It simply joins it with DATA_PATH using os.path.join
# So fn should be a string representing a filename or relative path

ARGS = {
    'fn': 'example_file.txt'
}
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 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
split Ran
ran on a synthesized input
ZhecanJamesWang/GLAT_SGG/lib/models_kern.py
code served (permissive licence) · get_code("9178ea1334f34247")
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 tuple. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for testing
# fea: shape (batch_size, num_node, feature_dim)
batch_size = 2
num_node = 3
feature_dim = 4

fea = torch.randn(batch_size, num_node, feature_dim)

# node_type: shape (batch_size, num_node) with values 0, 1, or 2
# 0 = predicate, 1 = entity, 2 = blank
node_type = torch.tensor([
    [0, 1, 2],
    [1, 0, 2]
])

ARGS = {
    'fea': fea,
    'node_type': node_type
}
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 tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
stanford_path Ran
ran on a synthesized input
ZhecanJamesWang/GLAT_SGG/config.py
code served (permissive licence) · get_code("b907d8082fdf6836")
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 os

DATA_PATH = '/kiwi-data/projects/commonsense/shared/alireza_repo/metadata/VG/stanford/'

def stanford_path(fn):
    return os.path.join(DATA_PATH, fn)

ARGS = {
    'fn': 'test_file.txt'
}
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 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
gather_res Not yet run
unverified (harvested, no recorded run)
ZhecanJamesWang/GLAT_SGG/lib/object_detector.py
code served (permissive licence) · get_code("013f03d1624b019d")
How it ran

no invocation recorded.

vgg_fc Not yet run
unverified (harvested, no recorded run)
ZhecanJamesWang/GLAT_SGG/lib/resnet.py
code served (permissive licence) · get_code("16d7f949c9b0c390")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 6 later) and 4 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
pairwise 9 other papers
3 dated earlier, 6 later
1812.01880 (2018-12)
Learning to Compose Dynamic Tree Structures for Visual Contexts
1903.03326 (2019-03)
Knowledge-Embedded Routing Network for Scene Graph Generation
2003.12962 (2020-03)
GPS-Net: Graph Property Sensing Network for Scene Graph Generation
and 6 more not named here
get_ranking 5 other papers
3 dated earlier, 2 later
1812.01880 (2018-12)
Learning to Compose Dynamic Tree Structures for Visual Contexts
1903.03326 (2019-03)
Knowledge-Embedded Routing Network for Scene Graph Generation
2003.12962 (2020-03)
GPS-Net: Graph Property Sensing Network for Scene Graph Generation
and 2 more not named here
optimistic_restore 4 other papers
3 dated earlier, 1 later
1812.01880 (2018-12)
Learning to Compose Dynamic Tree Structures for Visual Contexts
1903.03326 (2019-03)
Knowledge-Embedded Routing Network for Scene Graph Generation
2003.12962 (2020-03)
GPS-Net: Graph Property Sensing Network for Scene Graph Generation
and 1 more not named here
gather_res 3 other papers
2 dated earlier, 1 later
1812.01880 (2018-12)
Learning to Compose Dynamic Tree Structures for Visual Contexts
1903.03326 (2019-03)
Knowledge-Embedded Routing Network for Scene Graph Generation
2403.12033 (2024-03)
HiKER-SGG: Hierarchical Knowledge Enhanced Robust Scene Graph Generation
vgg_fc 3 other papers
2 dated earlier, 1 later
1812.01880 (2018-12)
Learning to Compose Dynamic Tree Structures for Visual Contexts
1903.03326 (2019-03)
Knowledge-Embedded Routing Network for Scene Graph Generation
2403.12033 (2024-03)
HiKER-SGG: Hierarchical Knowledge Enhanced Robust Scene Graph Generation
filter_dets 2 other papers
1 dated earlier, 1 later
1903.03326 (2019-03)
Knowledge-Embedded Routing Network for Scene Graph Generation
2403.12033 (2024-03)
HiKER-SGG: Hierarchical Knowledge Enhanced Robust Scene Graph Generation
path 2 other papers
2 dated earlier
1812.01880 (2018-12)
Learning to Compose Dynamic Tree Structures for Visual Contexts
1903.03326 (2019-03)
Knowledge-Embedded Routing Network for Scene Graph Generation

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

Repositories linked to this paper

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

Abstract

Scene graph generation models understand the scene through object and predicate recognition, but are prone to mistakes due to the challenges of perception in the wild. Perception errors often lead to nonsensical compositions in the output scene graph, which do not follow real-world rules and patterns, and can be corrected using commonsense knowledge. We propose the first method to acquire visual commonsense such as affordance and intuitive physics automatically from data, and use that to improve the robustness of scene understanding. To this end, we extend Transformer models to incorporate the structure of scene graphs, and train our Global-Local Attention Transformer on a scene graph corpus. Once trained, our model can be applied on any scene graph generation model and correct its obvious mistakes, resulting in more semantically plausible scene graphs. Through extensive experiments, we show our model learns commonsense better than any alternative, and improves the accuracy of state-of-the-art scene graph generation methods.

For agents

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

get_harvested_code_for_paper("2006.09623")
get_code_for_paper("2006.09623")
have("2006.09623")

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

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

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

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

Connect an agent — have() is free.