All models

cyclegan_resnet_9blocks_generator

The CycleGAN generator: a residual image-to-image network that learned to translate without paired examples.

Diffusion and generative · 91 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (53 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
11.4M
Operations
91
Framework
PyTorch
Recurrent
No
Published
ICCV 2017
Cited by
5,615 (as of 4 October 2026)
Authors
Jun-Yan Zhu, Taesung Park, Phillip Isola, Alexei A. Efros
License
BSD-3-Clause
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m11761
Graph hash
c0a492022a9f7e3ba4c3238424ea79892f0d50ee93a0c1a8c4ff8d86f385292c
Skeleton hash
478556159861147bdd42d9af0c2f1669f2c7dac0531cbd4eb5eae71da2f568c5
Architecture hash
10cd8038a439881d4f0ca91b88f3e6c86048eab2840533b30bc2b0e24269bbeb
Diagram SHA-256
2848226fa49f628b7b14f1a4ab165a20971a4dba115d9d803298f4813f0599ab
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This is the 9-residual-block generator the paper uses for 256 × 256 or higher-resolution training images.

About this model's family

CycleGAN is an approach for learning to translate an image from a source domain X to a target domain Y in the absence of paired examples. The goal is a mapping G such that the distribution of images from G(X) is indistinguishable from the distribution Y using an adversarial loss. Because this mapping is highly under-constrained, it is coupled with an inverse mapping F and a cycle consistency loss that pushes F(G(X)) back towards X. Results are shown on collection style transfer, object transfiguration, season transfer and photo enhancement, tasks where paired training data does not exist.

What is traced here is the generator network. Its architecture is adopted from Johnson et al., who had shown impressive results for neural style transfer and super-resolution. The network contains three convolutions, several residual blocks, two fractionally-strided convolutions, and one convolution that maps features to RGB. Like Johnson et al., it uses instance normalization. Each residual block contains two 3 × 3 convolutional layers with the same number of filters on both layers. Reflection padding was used to reduce artifacts. In the paper's notation the 9-block network reads c7s1-64, d128, d256, nine R256 blocks, u128, u64, c7s1-3: a 7 × 7 stem, two stride-2 downsampling convolutions, the residual trunk, two upsampling layers and a 7 × 7 output convolution.

The paper uses 6 residual blocks for 128 × 128 training images and 9 residual blocks for 256 × 256 or higher-resolution training images, and both variants are captured as members. All the models were trained on 256 × 256 images. The official PyTorch repository produces results comparable to or better than the original Torch software, and it ships pretrained CycleGAN generators such as horse2zebra. The pretrained generator is saved as latest_net_G.pth under a checkpoints folder named for the dataset.

Key idea. Unpaired image-to-image translation: an adversarial loss makes G(X) look like Y while a cycle consistency loss with an inverse mapping F pushes F(G(X)) back to X, so the generator can be trained without aligned image pairs.

  • CycleGAN
  • CycleGAN generator
  • ResnetGenerator
  • resnet_9blocks
  • resnet_6blocks
  • cycle-consistent adversarial networks
  • unpaired image-to-image translation
  • horse2zebra
  • style transfer
  • Johnson et al. generator
  • pytorch-CycleGAN-and-pix2pix

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{zhu2020unpairedimagetoimagetranslationusing,
      title={Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks}, 
      author={Jun-Yan Zhu and Taesung Park and Phillip Isola and Alexei A. Efros},
      year={2020},
      eprint={1703.10593},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1703.10593}, 
}