SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1809.01852 · 2018

GAMENet: Graph Augmented MEmory Networks for Recommending Medication Combination

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 0 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/1809.01852.json · badge: /api/ran/1809.01852.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
sjy1203/GAMENet canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
create_dataset Ran
ran; our contract draft was wrong, not the code
sjy1203/GAMENet/code/baseline/train_LR.py
code served (permissive licence) · get_code("2924bead46e7078e")
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 numpy as np

class MockVocab:
    def __init__(self, size):
        self.idx2word = {i: f"word_{i}" for i in range(size)}

# Create mock vocabulary objects with distinct sizes
diag_voc = MockVocab(5)      # diagnosis vocab size: 5
pro_voc = MockVocab(3)       # procedure vocab size: 3
med_voc = MockVocab(4)       # medication vocab size: 4

# Create sample data structure
# data is a list of patients, each patient is a list of visits
# Each visit is a tuple of (diagnoses_indices, procedures_indices, medications_indices)
data = [
    [
        ([0, 1], [0, 2], [1, 2, 3]),      # Patient 0, Visit 0
        ([2], [1], [0, 3]),                # Patient 0, Visit 1
    ],
    [
        ([1, 3], [0], [1, 2]),             # Patient 1, Visit 0
        ([4], [2], [2, 3]),                # Patient 1, Visit 1
    ]
]

ARGS = {
    "data": data,
    "diag_voc": diag_voc,
    "pro_voc": pro_voc,
    "med_voc": med_voc,
}
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 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_n_params Ran
ran, honoured the contract we drafted
sjy1203/GAMENet/code/util.py
pointer only (licence: MIT); the stored copy get_code serves, from ldkong1205/openess, is pointer only (licence: NONE) · get_code("c6acd3e400fc2676")
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 ldkong1205/openess, 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.

precision_at_k_v2 Ran
ran on a synthesized input
sjy1203/GAMENet/code/deplicated/train_two_loss.py
code served (permissive licence) · get_code("02918763beebe72e")
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 float, 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 numpy as np

# Construct arguments for precision_at_k_v2
# The function expects:
# - y_gt: ground truth binary matrix (batch_size, num_classes)
# - y_prob: probability scores matrix (batch_size, num_classes)
# - k: number of top predictions to consider

batch_size = 2
num_classes = 4

# Ground truth labels: binary matrix where 1 indicates the class is correct
y_gt = np.array([
    [1, 0, 0, 1],  # First sample has correct classes at indices 0 and 3
    [0, 1, 1, 0]   # Second sample has correct classes at indices 1 and 2
])

# Probability scores: higher values indicate higher confidence
y_prob = np.array([
    [0.9, 0.1, 0.2, 0.8],  # Sorted descending: [0.9, 0.8, 0.2, 0.1] at indices [0, 3, 2, 1]
    [0.3, 0.7, 0.6, 0.2]   # Sorted descending: [0.7, 0.6, 0.3, 0.2] at indices [1, 2, 0, 3]
])

k = 3

ARGS = {
    'y_gt': y_gt,
    'y_prob': y_prob,
    'k': k
}
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 float, 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
sequence_output_process Ran
ran on a synthesized input
sjy1203/GAMENet/code/util.py
code served (permissive licence) · get_code("8dd9d40b83a08b54")
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 2, 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 numpy as np

# Construct valid arguments for sequence_output_process

# output_logits: a 2D numpy array of shape (batch_size, num_classes)
# The function uses np.argsort on axis=-1, indexes with [i][j], and accesses [idx, item]
output_logits = np.random.randn(2, 4).astype(np.float32)
# Make some values distinct so we can trace through the logic
output_logits[0] = [3.2, 1.5, 2.1, 0.8]
output_logits[1] = [0.5, 4.1, 1.2, 2.3]

# filter_token: a collection (list, set, etc.) of token indices to filter out
# The function checks "if label in filter_token"
filter_token = [2]

ARGS = {
    "output_logits": output_logits,
    "filter_token": filter_token,
}
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 tuple, ndim 2, dtype family int — 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
sequence_output_process Ran
ran on a synthesized input
sjy1203/GAMENet/code/baseline/train_DMNC.py
code served (permissive licence) · get_code("e571d04a8a170367")
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 2, 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 numpy as np

# Analyze the function:
# - output_logits: numpy array, used with np.argsort and indexing [i][j] and [idx, item]
#   Shape should be (batch_size, num_classes)
# - filter_token: container type, checked with 'in' operator
#   Should be a set or list of token indices to filter

np.random.seed(0)

# Create output_logits: shape (2, 4) - batch of 2, 4 possible tokens
output_logits = np.random.randn(2, 4).astype(np.float32)

# Create filter_token: a set of token indices to exclude
filter_token = {0}  # Filter out token 0

ARGS = {
    "output_logits": output_logits,
    "filter_token": filter_token,
}
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 tuple, ndim 2, dtype family int — 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
transform_split Ran
ran on a synthesized input
sjy1203/GAMENet/code/util.py
code served (permissive licence) · get_code("b921bcf0b736e00a")
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 numpy as np
from sklearn.model_selection import train_test_split

# Set random seed for reproducibility
np.random.seed(0)

# Create small synthetic data
# X: 12 samples, 4 features
# Y: 12 labels
X = np.random.randn(12, 4)
Y = np.random.randint(0, 2, 12)

ARGS = {
    "X": X,
    "Y": Y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 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
get_n_params 14 other papers
14 later
1912.09363 (2019-12)
Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting
2003.01332 (2020-03)
Heterogeneous Graph Transformer
2004.12992 (2020-04)
MakeItTalk: Speaker-Aware Talking-Head Animation
and 11 more not named here
create_dataset 1 other paper
1 later
2403.17745 (2024-03)
Leave No Patient Behind: Enhancing Medication Recommendation for Rare Disease Patients

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

Recent progress in deep learning is revolutionizing the healthcare domain including providing solutions to medication recommendations, especially recommending medication combination for patients with complex health conditions. Existing approaches either do not customize based on patient health history, or ignore existing knowledge on drug-drug interactions (DDI) that might lead to adverse outcomes. To fill this gap, we propose the Graph Augmented Memory Networks (GAMENet), which integrates the drug-drug interactions knowledge graph by a memory module implemented as a graph convolutional networks, and models longitudinal patient records as the query. It is trained end-to-end to provide safe and personalized recommendation of medication combination. We demonstrate the effectiveness and safety of GAMENet by comparing with several state-of-the-art methods on real EHR data. GAMENet outperformed all baselines in all effectiveness measures, and also achieved 3.60% DDI rate reduction from existing EHR data.

For agents

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

get_harvested_code_for_paper("1809.01852")
get_code_for_paper("1809.01852")
have("1809.01852")

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

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

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

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

Connect an agent — have() is free.