SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1806.02920 · 2018

GAIN: Missing Data Imputation using Generative Adversarial Nets

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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 6 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/1806.02920.json · badge: /api/ran/1806.02920.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
vanderschaarlab/autoprognosis community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
javiersgjavi/GAIN-Pytorch-Lightning community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
evolext/GAIN reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
add_missings Ran
ran; our contract draft was wrong, not the code
evolext/GAIN/usage_example.py
pointer only (licence: NONE) · get_code("a8f2fc3e489a4f0b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, evolext/GAIN 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.

create_log_and_print_function Ran
ran; our contract draft was wrong, not the code
vanderschaarlab/autoprognosis/src/autoprognosis/logger.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from QiyaoWei/Expertise, is pointer only (licence: NONE) · get_code("4c35427d43331cd0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from QiyaoWei/Expertise, 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.

file_md5 Ran
ran on a synthesized input
vanderschaarlab/autoprognosis/src/autoprognosis/deploy/utils.py
code served (permissive licence) · get_code("3f19c5bd16fdbc0c")
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 hashlib
from pathlib import Path
import tempfile
import os

# Create a temporary file with some content
temp_dir = tempfile.mkdtemp()
temp_file = Path(temp_dir) / "test_file.txt"
with open(temp_file, 'w') as f:
    f.write("Hello, this is test content for MD5 hashing.\n" * 10)

ARGS = {
    "fname": temp_file
}
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
generate_missing_mask Ran
ran on a synthesized input
javiersgjavi/GAIN-Pytorch-Lightning/src/utils.py
code served (permissive licence) · get_code("20da4d2fa83c9ca0")
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 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

torch.manual_seed(0)

# Create small input tensor
x = torch.randn(2, 4)

# Create input mask tensor (True indicates valid values, False indicates missing)
input_mask = torch.ones(2, 4, dtype=torch.bool)

# Set missing_rate as a float between 0 and 1
missing_rate = 0.3

ARGS = {
    "x": x,
    "input_mask": input_mask,
    "missing_rate": missing_rate,
}
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, ndim 3, 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
get_ports Ran
ran on a synthesized input
vanderschaarlab/autoprognosis/src/autoprognosis/deploy/utils.py
code served (permissive licence) · get_code("03d93bad5a276b63")
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 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 os
import psutil

# The function get_ports takes a pid (process id) as an integer parameter
# It uses psutil.Process(pid) to get a process object, then calls .connections()
# on it to get connection information. It filters for LISTEN status connections
# and extracts the port from conn.laddr.port

# We need to provide a valid pid. We can use the current process's pid
current_pid = os.getpid()

ARGS = {
    'pid': current_pid
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
psutil — 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 float — 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
is_local_port_open Ran
ran on a synthesized input
vanderschaarlab/autoprognosis/src/autoprognosis/deploy/utils.py
code served (permissive licence) · get_code("e4a86ddf71deb01a")
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 socket
from contextlib import closing

# The function checks if a local port is open by attempting to connect to it
# It takes a single parameter: port (an int)
# The function will try to connect to 127.0.0.1 on the given port
# We should provide a port number that is unlikely to be in use, or we can provide
# a high port number in the ephemeral range

ARGS = {
    "port": 65432
}
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 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
loss_d Ran
ran on a synthesized input
javiersgjavi/GAIN-Pytorch-Lightning/src/utils.py
code served (permissive licence) · get_code("41e8673c5a47185d")
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. 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

torch.manual_seed(0)

# d_prob: discriminator output probabilities, should be values between 0 and 1
# Shape: (batch_size, 1) or similar
d_prob = torch.sigmoid(torch.randn(2, 1))

# m: mask tensor indicating location of missing values, should be binary (0 or 1)
# Shape: (batch_size, 1) or same as d_prob
m = torch.randint(0, 2, (2, 1)).float()

ARGS = {
    "d_prob": d_prob,
    "m": m,
}
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
loss_g Ran
ran on a synthesized input
javiersgjavi/GAIN-Pytorch-Lightning/src/utils.py
code served (permissive licence) · get_code("0193c5aa7f5a1eae")
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. 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)

# d_prob: discriminator output probabilities - should be in range [0, 1]
# Shape: (batch_size, 1) or similar
d_prob = torch.sigmoid(torch.randn(2, 1))

# m: mask tensor indicating location of missing values
# Shape should match d_prob for broadcasting in (1 - m) * torch.log(d_prob + 1e-08)
m = torch.randint(0, 2, (2, 1)).float()

ARGS = {
    "d_prob": d_prob,
    "m": m,
}
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

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
create_log_and_print_function 8 other papers
8 later
2110.12884 (2021-10)
DECAF: Generating Fair Synthetic Data Using Causally-Aware Generative Networks
2111.03187 (2021-11)
MIRACLE: Causally-Aware Imputation via Learning Missing Data Mechanisms
2206.07769 (2022-06)
HyperImpute: Generalized Iterative Imputation with Automatic Model Selection
and 5 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

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

Abstract

We propose a novel method for imputing missing data by adapting the well-known Generative Adversarial Nets (GAN) framework. Accordingly, we call our method Generative Adversarial Imputation Nets (GAIN). The generator (G) observes some components of a real data vector, imputes the missing components conditioned on what is actually observed, and outputs a completed vector. The discriminator (D) then takes a completed vector and attempts to determine which components were actually observed and which were imputed. To ensure that D forces G to learn the desired distribution, we provide D with some additional information in the form of a hint vector. The hint reveals to D partial information about the missingness of the original sample, which is used by D to focus its attention on the imputation quality of particular components. This hint ensures that G does in fact learn to generate according to the true data distribution. We tested our method on various datasets and found that GAIN significantly outperforms state-of-the-art imputation methods.

For agents

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

get_harvested_code_for_paper("1806.02920")
get_code_for_paper("1806.02920")
have("1806.02920")

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

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

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

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

Connect an agent — have() is free.