Papers › Rewriting a Deep Generative Model

Rewriting a Deep Generative Model

30 Jul 2020ECCV 2020 8arXiv:2007.15646archive 2025-07-28

David Bau, Steven Liu, Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba

A deep generative model such as a GAN learns to model a rich set of semantic and physical rules about the target distribution, but up to now, it has been obscure how such rules are encoded in the network, or how a rule could be changed. In this paper, we introduce a new problem setting: manipulation of specific rules encoded by a deep generative model. To address the problem, we propose a formulation in which the desired rule is changed by manipulating a layer of a deep network as a linear associative memory. We derive an algorithm for modifying one entry of the associative memory, and we demonstrate that several interesting structural rules can be located and modified within the layers of state-of-the-art generative models. We present a user interface to enable users to interactively change the rules of a generative model to achieve desired effects, and we show several proof-of-concept applications. Finally, results on multiple datasets demonstrate the advantage of our method against standard fine-tuning methods and edit transfer algorithms.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 23 code samples harvested from 3 repositories linked to this paper: 18 ran (of which 0 constructed an object rather than computing a result; 13 with no instrument failure: 4 honoured, 1 violated, 8 with no contract checked; 5 where Syntology's instrument failed) · 5 unverified. Where Syntology's instrument failed: 3 where our contract draft was wrong; 2 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 4 samples from 1 repository, 4 ran (3 with no instrument failure; 1 where Syntology's instrument failed); community (archive-listed): 19 samples from 2 repositories, 14 ran (10 with no instrument failure; 4 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 2 of the 18 samples that ran have no recorded date.

davidbau/rewriting officialpytorchSyntology: 4 samples, 4 ran (1 instrument-failed) · 0 unverified report
PeterWang512/GANSketching mentioned on GitHubpytorchMITSyntology: 16 samples, 11 ran (3 instrument-failed) · 5 unverified report
revsic/Rewriting-A-Deep-Generative-Models mentioned on GitHubpytorchMITSyntology: 3 samples, 3 ran (1 instrument-failed) · 0 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

23 samples harvested: 18 ran (of which 0 constructed an object rather than computing a result; 13 with no instrument failure: 4 honoured, 1 violated, 8 with no contract checked; 5 where Syntology's instrument failed) · 5 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

4ran · honoured contract
1ran · violated contract
3ran · our draft was wrong
2ran; the contract check could not run
8ran
5unverified

Licence: 5 of the 23 samples are pointer only, meaning Syntology does not serve that copy's text. For 5 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

davidbau/rewriting official repository 4 samples, 4 ran (1 instrument-failed) · 0 unverified
centered_location rewrite/ganrewrite.py ran · honoured contract fingerprinted MIT (permissive) · 7ad7dc9cfae49b02 · report fixture: signature data:Tensor/2/float · returned tuple · level recorded 2026-09-22
make_kernel in 34 papers utils/stylegan2/models.py ran · violated contract MIT (permissive) · 9ea2d5da223e8492 · report fixture: signature k:list/1/float · returned Tensor · level recorded 2026-09-22
paste_clip_at_center rewrite/ganrewrite.py ran; the contract check could not run (RAISES) · metamorphic tier: deterministic fingerprinted MIT (permissive) · 36f9b37b3b5c5296 · report fixture: signature source:Tensor/4/float, clip:Tensor/4/float, center:tuple/1/int, area:Tensor/2/float · returned tuple · level recorded 2026-09-22
positive_bounding_box rewrite/ganrewrite.py ran · honoured contract fingerprinted MIT (permissive) · c3b0830b8cc3c87b · report fixture: signature data:Tensor/2/float · returned tuple · level recorded 2026-09-22
PeterWang512/GANSketching community (archive-listed) 16 samples, 11 ran (3 instrument-failed) · 5 unverified
create_dataloader in 35 papers training/dataset.py ran MIT (permissive) · 53eba98d072664b8 · report fixture: signature data_dir:str/0/str, size:tuple/1/int, batch:int/0/int, img_channel:int/0/int · returned tuple · level recorded 2026-09-24
data_sampler in 17 papers training/dataset.py ran MIT (permissive) · d2adc53663eaf8a1 · report fixture: signature dataset:SimpleDataset/0/?, shuffle:bool/0/bool · returned RandomSampler · level recorded 2026-09-24
gen_principal_components ganspace.py ran MIT (permissive) · 3ff05cdbf246edc5 · report fixture: signature dump_name:str/0/str, device:str/0/str · returned tuple · level recorded 2026-09-24
get_param_by_name training/gan_model.py ran MIT (permissive) · 00215dbe8680445b · report fixture: signature net:callable/0/?, tgt_param:str/0/str · returned tuple · level recorded 2026-09-24
lerp in 27 papers
census: 4 implementations from 6 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32 · arg 2: rank 2, kind float, dtype float32
eval/ppl.py ran · honoured contract fingerprinted MIT (permissive) here; the stored copy is pointer only · 0c45399f3741921e · report fixture: signature a:Tensor/2/float, b:Tensor/2/float, t:float/0/float · returned Tensor · level recorded 2026-09-22
mixing_noise training/gan_model.py ran MIT (permissive) · feeb5b7716528a75 · report fixture: signature batch:int/0/int, latent_dim:int/0/int, prob:float/0/float, device:str/0/str · returned tuple · level recorded 2026-09-24
normalize in 638 papers
census: 70 implementations from 82 papers, 51 distinct outputs across 11 buckets, one shared input per bucket
eval/ppl.py ran fingerprinted MIT (permissive) · bfd30ba25798287e · report fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-24
rand_brightness in 25 papers
census: 7 implementations from 9 papers, 5 distinct outputs across 2 buckets, one shared input per bucket this sample: bucket 1 of 2, arg 1: rank 4, kind float, dtype float32
training/networks/diffaug.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · 011230b2b9b8fb6f · report fixture: signature x:Tensor/4/float · returned Tensor · level recorded, date not recorded
rand_contrast in 7 papers
census: 6 implementations from 6 papers, 3 distinct outputs across 2 buckets, one shared input per bucket this sample: bucket 1 of 2, arg 1: rank 4, kind float, dtype float32
training/networks/diffaug.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted MIT (permissive) · cf3f99cfbe8f451a · report fixture: signature x:Tensor/4/float · returned Tensor · level recorded 2026-09-22
rand_saturation in 24 papers
census: 6 implementations from 9 papers, 3 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 4, kind float, dtype float32
training/networks/diffaug.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · 5b0d8787e670fc63 · report fixture: signature x:Tensor/4/float · returned Tensor · level recorded, date not recorded
slerp in 28 papers
census: 6 implementations from 6 papers, 6 distinct outputs across 2 buckets, one shared input per bucket
eval/ppl.py ran fingerprinted MIT (permissive) · 904ef2c2720850a0 · report fixture: signature a:Tensor/2/float, b:Tensor/2/float, t:Tensor/2/float · returned Tensor · level recorded 2026-09-24
apply_shift ganspace.py unverified MIT (permissive) · e31916f9b07f1f86 · report
define_D in 17 papers training/networks/misc.py unverified MIT (permissive) · d976b9fd5ba3e472 · report
define_G in 29 papers training/networks/misc.py unverified MIT (permissive) · 82adc25dc5feb7de · report
get_stats in 37 papers run_metrics.py unverified MIT (permissive) · 0c04f59973771055 · report
get_vgg_features run_metrics.py unverified MIT (permissive) · f7014d8c994c5c5b · report
revsic/Rewriting-A-Deep-Generative-Models community (archive-listed) 3 samples, 3 ran (1 instrument-failed) · 0 unverified
apply_ablation_replacement in 5 papers utils/nethook.py ran · honoured contract MIT (permissive) here; the stored copy is pointer only · e6e2771a0de59277 · report fixture: signature x:Tensor/2/float, imodel:callable/0/?, buffers:dict/0/? · returned Tensor · level recorded 2026-09-22
make_matching_tensor in 5 papers utils/nethook.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · 0a92af765d5132e3 · report fixture: signature valuedict:dict/0/?, name:str/0/str, data:Tensor/4/float · returned Tensor · level recorded 2026-09-22
subsequence in 51 papers utils/nethook.py ran MIT (permissive) · 4746337d187a61f7 · report fixture: signature sequential:callable/0/?, first_layer:str/0/str, last_layer:str/0/str, after_layer:NoneType/0/?, upto_layer:NoneType/0/?, single_layer:NoneType/0/?, share_weights:bool/0/bool · returned Sequential · level recorded 2026-09-24

Tasks

model

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections