SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1802.08773 · 2018

GraphRNN: Generating Realistic Graphs with Deep Auto-regressive Models

arXiv · PDF · Open in the Atlas

Code that ran

8 of 19 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; 2 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 11 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1802.08773.json · badge: /api/ran/1802.08773.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
snap-stanford/GraphRNN canonical (classifier label)
classifier basis: census
8 ran · 11 no recorded run
FunctionStatusWhere it lives
binary_cross_entropy_weight Ran
ran on a synthesized input
snap-stanford/GraphRNN/model.py
code served (permissive licence) · get_code("b59409263831240e")
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 0, dtype family float, shape () as a later run recorded it. 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, 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.functional as F

torch.manual_seed(0)

# Create small tensors with distinct dimensions
batch_size = 2
seq_length = 5
feature_dim = 4

# y_pred: predicted probabilities, shape (batch_size, seq_length, feature_dim)
y_pred = torch.sigmoid(torch.randn(batch_size, seq_length, feature_dim))

# y: target binary labels, shape (batch_size, seq_length, feature_dim)
y = torch.randint(0, 2, (batch_size, seq_length, feature_dim)).float()

# Test with has_weight=False
ARGS = {
    "y_pred": y_pred,
    "y": y,
    "has_weight": False,
    "weight_length": 1,
    "weight_max": 10
}
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 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
create Ran
ran on a synthesized input
snap-stanford/GraphRNN/create_graphs.py
code served (permissive licence) · get_code("72a0035803c73117")
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. 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 networkx as nx
import numpy as np
from types import SimpleNamespace

class Args:
    def __init__(self, graph_type):
        self.graph_type = graph_type
        self.max_prev_node = None
        self.noise = 0.5

# Create a minimal args object for 'ladder_small' graph type
# This is the simplest case that doesn't require external data loading
ARGS = {
    'args': Args('ladder_small')
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
extract_result_id_and_epoch Ran
ran on a synthesized input
snap-stanford/GraphRNN/evaluate.py
code served (permissive licence) · get_code("994f652e081e1e2f")
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, ndim 1, 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 numpy as np

def extract_result_id_and_epoch(name, prefix, suffix):
    """
    Args:
        eval_every: the number of epochs between consecutive evaluations
        suffix: real_ or pred_
    Returns:
        A tuple of (id, epoch number) extracted from the filename string
    """
    pos = name.find(suffix) + len(suffix)
    end_pos = name.find('.dat')
    result_id = name[pos:end_pos]
    pos = name.find(prefix) + len(prefix)
    end_pos = name.find('_', pos)
    epochs = int(name[pos:end_pos])
    return (result_id, epochs)


# Construct valid arguments
# The function expects a filename string with specific structure
# It looks for: prefix_EPOCHS_..._suffix_RESULT_ID.dat

ARGS = {
    "name": "checkpoint_42_model_real_result123.dat",
    "prefix": "checkpoint_",
    "suffix": "real_"
}
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 tuple, ndim 1, dtype family float — a tuple 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
find_nearest_idx Ran
ran, honoured the contract we drafted
snap-stanford/GraphRNN/evaluate.py
code served (permissive licence) · get_code("a39feeeaa3cceac3")
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 int64, 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 numpy as np

# Create a numpy array with some sample values
array = np.array([1.2, 3.5, 5.8, 7.1, 9.3])

# Create a value to search for
value = 5.5

# Construct the ARGS dictionary
ARGS = {
    "array": array,
    "value": value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int64, 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
gumbel_softmax Ran
ran on a synthesized input
snap-stanford/GraphRNN/model.py
code served (permissive licence) · get_code("7c1c7cc69fad8a40")
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. 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, 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.functional as F
from torch.autograd import Variable

torch.manual_seed(0)

# Create logits tensor: shape N*L (batch_size=2, sequence_length=4)
logits = torch.randn(2, 4)

# Temperature parameter for controlling softness of softmax
temperature = 0.5

# Epsilon for numerical stability
eps = 1e-09

ARGS = {
    "logits": logits,
    "temperature": temperature,
    "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 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
parse_index_file Ran
ran, honoured the contract we drafted
snap-stanford/GraphRNN/data.py
code served (permissive licence) · get_code("5c3fa9402a9405bc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned 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 tempfile
import os

# Create a temporary file with index data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("0\n")
temp_file.write("1\n")
temp_file.write("5\n")
temp_file.write("3\n")
temp_file.close()

ARGS = {
    "filename": temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
perturb Ran
ran on a synthesized input
snap-stanford/GraphRNN/utils.py
code served (permissive licence) · get_code("8f7d2c1aa425efe6")
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. 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 networkx as nx
import numpy as np

np.random.seed(0)

# Create a few small test graphs
G1 = nx.Graph()
G1.add_edges_from([(0, 1), (1, 2), (2, 3), (0, 3)])

G2 = nx.Graph()
G2.add_edges_from([(0, 1), (1, 2), (2, 0)])

# Create the graph_list parameter
graph_list = [G1, G2]

# Set probability of deletion
p_del = 0.3

# Set probability of addition (optional - can be None)
p_add = 0.2

ARGS = {
    "graph_list": graph_list,
    "p_del": p_del,
    "p_add": p_add,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
sample_tensor Ran
ran on a synthesized input
snap-stanford/GraphRNN/model.py
code served (permissive licence) · get_code("81dc19acb93da0ce")
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. 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, 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)

# Create a small tensor with values between 0 and 1 (suitable for sampling)
y = torch.rand(2, 4)

ARGS = {
    "y": y,
    "sample": True,
    "thresh": 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 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
Graph_generator_baseline Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/baselines/baseline_simple.py
code served (permissive licence) · get_code("b919a065e6ff5ab5")
How it ran

no invocation recorded.

Graph_generator_baseline_train_rulebased Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/baselines/baseline_simple.py
code served (permissive licence) · get_code("60c01e040605bf2d")
How it ran

no invocation recorded.

Graph_load Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/data.py
code served (permissive licence) · get_code("29a4794f08fa2a32")
How it ran

no invocation recorded.

Graph_load_batch Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/data.py
code served (permissive licence) · get_code("40a42cd12145989b")
How it ran

no invocation recorded.

caveman_special Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/utils.py
code served (permissive licence) · get_code("ad16299d7054b46e")
How it ran

no invocation recorded.

disjoint_cliques_test_graph Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/baselines/mmsb.py
code served (permissive licence) · get_code("56606455e061b557")
How it ran

no invocation recorded.

find_nearest_idx Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/analysis.py
code served (permissive licence) · get_code("4c7a3523d6683b3a")
How it ran

no invocation recorded.

graph_gen_from_blockmodel Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/baselines/mmsb.py
code served (permissive licence) · get_code("e33bc4d6f9298826")
How it ran

no invocation recorded.

n_community Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/utils.py
code served (permissive licence) · get_code("19bff1c9b578d1ae")
How it ran

no invocation recorded.

test_DGMG_epoch Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/main_DeepGMG.py
code served (permissive licence) · get_code("0702999f51d7158b")
How it ran

no invocation recorded.

train_DGMG_forward_epoch Not yet run
unverified (harvested, no recorded run)
snap-stanford/GraphRNN/main_DeepGMG.py
code served (permissive licence) · get_code("0ec01a80015ba81c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 15 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
parse_index_file 53 other papers
4 dated earlier, 49 later · 1 only as an assembly brick
1603.08861 (2016-03)
Revisiting Semi-Supervised Learning with Graph Embeddings
1611.07308 (2016-11)
Variational Graph Auto-Encoders
1710.10568 (2017-10)
Stochastic Training of Graph Convolutional Networks with Variance Reduction
and 50 more not named here
find_nearest_idx 3 other papers
3 later
1910.00760 (2019-10)
Efficient Graph Generation with Graph Recurrent Attention Networks
2204.01613 (2022-04)
SPECTRE: Spectral Conditioning Helps to Overcome the Expressivity Limits of One-shot Graph Generators
2305.19337 (2023-05)
HiGen: Hierarchical Graph Generative Networks
caveman_special 1 other paper
1 later
1806.02473 (2018-06)
Graph Convolutional Policy Network for Goal-Directed Molecular 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-22.

Repositories linked to this paper

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

Abstract

Modeling and generating graphs is fundamental for studying networks in biology, engineering, and social sciences. However, modeling complex distributions over graphs and then efficiently sampling from these distributions is challenging due to the non-unique, high-dimensional nature of graphs and the complex, non-local dependencies that exist between edges in a given graph. Here we propose GraphRNN, a deep autoregressive model that addresses the above challenges and approximates any distribution of graphs with minimal assumptions about their structure. GraphRNN learns to generate graphs by training on a representative set of graphs and decomposes the graph generation process into a sequence of node and edge formations, conditioned on the graph structure generated so far. In order to quantitatively evaluate the performance of GraphRNN, we introduce a benchmark suite of datasets, baselines and novel evaluation metrics based on Maximum Mean Discrepancy, which measure distances between sets of graphs. Our experiments show that GraphRNN significantly outperforms all baselines, learning to generate diverse graphs that match the structural characteristics of a target set, while also scaling to graphs 50 times larger than previous deep models.

For agents

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

get_harvested_code_for_paper("1802.08773")
get_code_for_paper("1802.08773")
have("1802.08773")

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

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

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

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

Connect an agent — have() is free.