SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.01310 · 2019

DM-GAN: Dynamic Memory Generative Adversarial Networks for Text-to-Image Synthesis

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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 0 have no contract verdict; 4 failures of our instrument; 1 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/1904.01310.json · badge: /api/ran/1904.01310.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
MinfengZhu/DM-GAN reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
huiyegit/T2I_CL extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 1 no recorded run
FunctionStatusWhere it lives
calculate_activation_statistics Ran
ran; our contract draft was wrong, not the code
MinfengZhu/DM-GAN/eval/FID/fid_score.py
code served (permissive licence) · get_code("177298ecedde13ed")
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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal model that mimics Inception behavior
class MinimalInceptionModel(nn.Module):
    def __init__(self, output_dims=2048):
        super(MinimalInceptionModel, self).__init__()
        self.conv = nn.Conv2d(3, output_dims, kernel_size=3, padding=1)
    
    def forward(self, x):
        # Returns a tuple where first element is the feature map
        out = self.conv(x)
        # Return as tuple to match model(batch)[0] indexing in get_activations
        return (out,)

# Create a minimal model instance
model = MinimalInceptionModel(output_dims=2048)

# Create dummy images as a list of batches
# Each batch should be a tensor of shape (batch_size, 3, height, width)
# Values must be between 0 and 1
batch1 = torch.rand(2, 3, 8, 8)  # 2 images, 3 channels, 8x8 spatial dims
batch2 = torch.rand(2, 3, 8, 8)
images = [batch1, batch2]

ARGS = {
    "images": images,
    "model": model,
    "batch_size": 2,
    "dims": 2048,
    "cuda": False,
    "verbose": True
}
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 — 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
calculate_frechet_distance Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
MinfengZhu/DM-GAN/eval/FID/fid_score.py
code served (permissive licence) · get_code("25ef415d07e43e6f")
How it ran

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

np.random.seed(0)

# Create two multivariate Gaussian distributions with different dimensions for clarity
# mu1, mu2 should be 1D arrays of the same length (feature dimension)
# sigma1, sigma2 should be 2D covariance matrices of shape (feature_dim, feature_dim)

feature_dim = 5

# Mean vectors for two distributions
mu1 = np.random.randn(feature_dim)
mu2 = np.random.randn(feature_dim)

# Covariance matrices - need to be positive semi-definite
# Create them by A @ A.T to ensure they are valid covariance matrices
A1 = np.random.randn(feature_dim, feature_dim)
sigma1 = A1 @ A1.T

A2 = np.random.randn(feature_dim, feature_dim)
sigma2 = A2 @ A2.T

eps = 1e-06

ARGS = {
    'mu1': mu1,
    'sigma1': sigma1,
    'mu2': mu2,
    'sigma2': sigma2,
    'eps': eps
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, 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
get_activations Ran
ran; our contract draft was wrong, not the code
MinfengZhu/DM-GAN/eval/FID/fid_score.py
code served (permissive licence) · get_code("eb21740d88a30ecb")
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 ndarray, ndim 2, dtype family float, shape (4, 2048) 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 as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal Inception-like model that returns a tensor with spatial dims
class MinimalInceptionModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 2048, kernel_size=3, padding=1)
    
    def forward(self, x):
        # Returns tuple where first element is the feature map
        out = self.conv(x)
        return (out,)

# Create model instance
model = MinimalInceptionModel()

# Create dummy image data: (n_images, 3, height, width)
# Values between 0 and 1
images_list = [
    torch.rand(2, 3, 8, 8),  # First batch of 2 images
    torch.rand(2, 3, 8, 8),  # Second batch of 2 images
]

ARGS = {
    'images': images_list,
    'model': model,
    'batch_size': 2,
    'dims': 2048,
    'cuda': False,
    'verbose': True,
}
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 ndarray, ndim 2, dtype family float, shape (4, 2048) — shape (4, 2048) 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
l2norm Ran
ran; our contract draft was wrong, not the code
huiyegit/T2I_CL/DM-GAN+CL/code/pretrain_DAMSM.py
code served (permissive licence) · get_code("be7c4a676b9f1e19")
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 (4, 3) 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)

# Create a small tensor for X: shape (4, 3) where dim 0 is batch-like and dim 1 is features
X = torch.randn(4, 3)

# The function uses X with torch.pow, sum, sqrt, and div operations
# It needs dim parameter to specify which dimension to normalize over
# eps is a small constant to avoid division by zero

ARGS = {
    "X": X,
    "dim": 1,
    "eps": 1e-08
}
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 (4, 3) — shape (4, 3) 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
preprocess Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from hanzhanggit/StackGAN-inception-model
pointer only; the stored copy get_code serves, from hanzhanggit/StackGAN-inception-model, is pointer only (licence: NONE) · get_code("b85a728ed7aaaade")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 5 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 4 later) and 0 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
calculate_frechet_distance 74 other papers
4 dated earlier, 2 the same month, 68 later
1610.09585 (2016-10)
Conditional Image Synthesis With Auxiliary Classifier GANs
1706.08500 (2017-06)
GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium
1807.11458 (2018-07)
To learn image super-resolution, use a GAN to learn how to do image degradation first
and 71 more not named here
l2norm 12 other papers
1 dated earlier, 11 later · 2 only as an assembly brick
1803.08024 (2018-03)
Stacked Cross Attention for Image-Text Matching
2010.03403 (2020-10)
Universal Weighting Metric Learning for Cross-Modal Matching
2109.05433 (2021-09)
Are Gender-Neutral Queries Really Gender-Neutral? Mitigating Gender Bias in Image Search
and 9 more not named here
calculate_activation_statistics 3 other papers
3 later
2202.04053 (2022-02)
DALL-Eval: Probing the Reasoning Skills and Social Biases of Text-to-Image Generation Models
2311.06322 (2023-11)
Post-training Quantization for Text-to-Image Diffusion Models with Progressive Calibration and Activation Relaxing
2311.15941 (2023-11)
Tell2Design: A Dataset for Language-Guided Floor Plan Generation
get_activations 2 other papers
2 later
2202.04053 (2022-02)
DALL-Eval: Probing the Reasoning Skills and Social Biases of Text-to-Image Generation Models
2311.15941 (2023-11)
Tell2Design: A Dataset for Language-Guided Floor Plan Generation
preprocess 2 other papers
2 dated earlier
1605.05396 (2016-05)
Generative Adversarial Text to Image Synthesis
1612.03242 (2016-12)
StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generative Adversarial Networks

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

In this paper, we focus on generating realistic images from text descriptions. Current methods first generate an initial image with rough shape and color, and then refine the initial image to a high-resolution one. Most existing text-to-image synthesis methods have two main problems. (1) These methods depend heavily on the quality of the initial images. If the initial image is not well initialized, the following processes can hardly refine the image to a satisfactory quality. (2) Each word contributes a different level of importance when depicting different image contents, however, unchanged text representation is used in existing image refinement processes. In this paper, we propose the Dynamic Memory Generative Adversarial Network (DM-GAN) to generate high-quality images. The proposed method introduces a dynamic memory module to refine fuzzy image contents, when the initial images are not well generated. A memory writing gate is designed to select the important text information based on the initial image content, which enables our method to accurately generate images from the text description. We also utilize a response gate to adaptively fuse the information read from the memories and the image features. We evaluate the DM-GAN model on the Caltech-UCSD Birds 200 dataset and the Microsoft Common Objects in Context dataset. Experimental results demonstrate that our DM-GAN model performs favorably against the state-of-the-art approaches.

For agents

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

get_harvested_code_for_paper("1904.01310")
get_code_for_paper("1904.01310")
have("1904.01310")

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

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

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

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

Connect an agent — have() is free.