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 Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2007.15646")

Code

Syntology Ran 10 of 23 code samples harvested from 3 repositories linked to this paper; 13 have no recorded run. Of those that ran: 4 ran · honoured contract; 1 ran · violated contract; 3 ran · our draft was wrong; 2 ran · fixture could not drive it.

By repository: official repository: 4 samples from 1 repository, 4 ran; community (archive-listed): 19 samples from 2 repositories, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

davidbau/rewriting officialpytorch report
PeterWang512/GANSketching mentioned on GitHubpytorchMIT report
revsic/Rewriting-A-Deep-Generative-Models mentioned on GitHubpytorchMIT 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; 10 ran; 4 honoured the contract we drafted; 13 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · honoured contract
1ran · violated contract
3ran · our draft was wrong
2ran · fixture could not drive it
13unverified

Licence: 0 of the 23 samples are pointer only, meaning Syntology does not serve that copy's text. 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; each sample names its own and says which. “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. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (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 from a repository marked official are listed first. 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 four 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; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). 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.

centered_location davidbau/rewriting/rewrite/ganrewrite.py official repository ran · honoured contract fingerprinted MIT (permissive) · 7ad7dc9cfae49b02 · report
make_kernel davidbau/rewriting/utils/stylegan2/models.py official repository ran · violated contract MIT (permissive) · 9ea2d5da223e8492 · report
paste_clip_at_center davidbau/rewriting/rewrite/ganrewrite.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 36f9b37b3b5c5296 · report
positive_bounding_box davidbau/rewriting/rewrite/ganrewrite.py official repository ran · honoured contract fingerprinted MIT (permissive) · c3b0830b8cc3c87b · report
apply_ablation_replacement revsic/Rewriting-A-Deep-Generative-Models/utils/nethook.py community (archive-listed) ran · honoured contract MIT (permissive) · e6e2771a0de59277 · report
lerp PeterWang512/GANSketching/eval/ppl.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 0c45399f3741921e · report
make_matching_tensor revsic/Rewriting-A-Deep-Generative-Models/utils/nethook.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 0a92af765d5132e3 · report
rand_brightness PeterWang512/GANSketching/training/networks/diffaug.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 011230b2b9b8fb6f · report
rand_contrast PeterWang512/GANSketching/training/networks/diffaug.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · cf3f99cfbe8f451a · report
rand_saturation PeterWang512/GANSketching/training/networks/diffaug.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 5b0d8787e670fc63 · report
apply_shift PeterWang512/GANSketching/ganspace.py community (archive-listed) unverified MIT (permissive) · e31916f9b07f1f86 · report
create_dataloader PeterWang512/GANSketching/training/dataset.py community (archive-listed) unverified MIT (permissive) · 53eba98d072664b8 · report
data_sampler PeterWang512/GANSketching/training/dataset.py community (archive-listed) unverified MIT (permissive) · d2adc53663eaf8a1 · report
define_D PeterWang512/GANSketching/training/networks/misc.py community (archive-listed) unverified MIT (permissive) · d976b9fd5ba3e472 · report
define_G PeterWang512/GANSketching/training/networks/misc.py community (archive-listed) unverified MIT (permissive) · 82adc25dc5feb7de · report
gen_principal_components PeterWang512/GANSketching/ganspace.py community (archive-listed) unverified MIT (permissive) · 3ff05cdbf246edc5 · report
get_param_by_name PeterWang512/GANSketching/training/gan_model.py community (archive-listed) unverified MIT (permissive) · 00215dbe8680445b · report
get_stats PeterWang512/GANSketching/run_metrics.py community (archive-listed) unverified MIT (permissive) · 0c04f59973771055 · report
get_vgg_features PeterWang512/GANSketching/run_metrics.py community (archive-listed) unverified MIT (permissive) · f7014d8c994c5c5b · report
mixing_noise PeterWang512/GANSketching/training/gan_model.py community (archive-listed) unverified MIT (permissive) · feeb5b7716528a75 · report
normalize PeterWang512/GANSketching/eval/ppl.py community (archive-listed) unverified MIT (permissive) · bfd30ba25798287e · report
slerp PeterWang512/GANSketching/eval/ppl.py community (archive-listed) unverified MIT (permissive) · 904ef2c2720850a0 · report
subsequence revsic/Rewriting-A-Deep-Generative-Models/utils/nethook.py community (archive-listed) unverified MIT (permissive) · 4746337d187a61f7 · report

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