{"url":"/method/path-length-regularization","slug":"path-length-regularization","name":"Path Length Regularization","full_name":"Path Length Regularization","full_name_withheld":false,"description_markdown":"**Path Length Regularization** is a type of regularization for [generative adversarial networks](https://paperswithcode.com/methods/category/generative-adversarial-networks) that encourages good conditioning in the mapping from latent codes to images. The idea is to encourage that a fixed-size step in the latent space $\\mathcal{W}$ results in a non-zero, fixed-magnitude change in the image.\r\n\r\nWe can measure the deviation from this ideal empirically by stepping into random directions in the image space and observing the corresponding $\\mathbf{w}$ gradients. These gradients should have close to an equal length regardless of $\\mathbf{w}$ or the image-space direction, indicating that the mapping from the latent space to image space is well-conditioned.\r\n\r\nAt a single $\\mathbf{w} \\in \\mathcal{W}$ the local metric scaling properties of the generator mapping $g\\left(\\mathbf{w}\\right) : \\mathcal{W} \\rightarrow \\mathcal{Y}$ are captured by the Jacobian matrix $\\mathbf{J\\_{w}} = \\delta{g}\\left(\\mathbf{w}\\right)/\\delta{\\mathbf{w}}$. Motivated by the desire to preserve the expected lengths of vectors regardless of the direction, we formulate the regularizer as:\r\n\r\n$$ \\mathbb{E}\\_{\\mathbf{w},\\mathbf{y} \\sim \\mathcal{N}\\left(0, \\mathbf{I}\\right)} \\left(||\\mathbf{J}^{\\mathbf{T}}\\_{\\mathbf{w}}\\mathbf{y}||\\_{2} - a\\right)^{2} $$\r\n\r\nwhere $y$ are random images with normally distributed pixel intensities, and $w \\sim f\\left(z\\right)$, where $z$ are normally distributed. \r\n\r\nTo avoid explicit computation of the Jacobian matrix, we use the identity $\\mathbf{J}^{\\mathbf{T}}\\_{\\mathbf{w}}\\mathbf{y} = \\nabla\\_{\\mathbf{w}}\\left(g\\left(\\mathbf{w}\\right)·y\\right)$, which is efficiently computable using standard backpropagation. The constant $a$ is set dynamically during optimization as the long-running exponential moving average of the lengths $||\\mathbf{J}^{\\mathbf{T}}\\_{\\mathbf{w}}\\mathbf{y}||\\_{2}$, allowing the optimization to find a suitable global scale by itself.\r\n\r\nThe authors note that they find that path length regularization leads to more reliable and consistently behaving models, making architecture exploration easier. They also observe that the smoother generator is significantly easier to invert.","description_state":"present","introduced_year":null,"introduced_by":{"title":null,"paper":null,"first_author":null,"n_authors":0,"url_abs":null,"archive_paper_url":null},"source":{"url":"https://arxiv.org/abs/1912.04958v2","title":"Analyzing and Improving the Image Quality of StyleGAN","url_on_a_paper_host":true},"code_snippet_url":"https://github.com/NVlabs/stylegan2/blob/7d3145d23013607b987db30736f89fb1d3e10fad/training/loss.py#L156","code_snippet_url_on_a_code_host":true,"categories":[{"area":"General","area_id":"general","collection":"Regularization","url":"/methods/category/regularization","pwc_aliases":[]}],"n_papers_tagged":182,"archive_num_papers":null,"papers_newest_first":[{"paper":null,"title":"Pose and Facial Expression Transfer by using StyleGAN","date":"2025-04-17","arxiv_id":"2504.13021","n_code_links":0,"syntology":null},{"paper":"/paper/the-gan-is-dead-long-live-the-gan-a-modern","title":"The GAN is dead; long live the GAN! A Modern GAN Baseline","date":"2025-01-09","arxiv_id":"2501.05441","n_code_links":1,"syntology":{"ran":9,"of":11,"unverified":2,"pointer_only":11}},{"paper":"/paper/singular-value-scaling-efficient-generative","title":"Singular Value Scaling: Efficient Generative Model Compression via Pruned Weights Refinement","date":"2024-12-23","arxiv_id":"2412.17387","n_code_links":1,"syntology":null},{"paper":null,"title":"MyTimeMachine: Personalized Facial Age Transformation","date":"2024-11-21","arxiv_id":"2411.14521","n_code_links":0,"syntology":null},{"paper":"/paper/unsupervised-panoptic-interpretation-of","title":"Unsupervised Panoptic Interpretation of Latent Spaces in GANs Using Space-Filling Vector Quantization","date":"2024-10-27","arxiv_id":"2410.20573","n_code_links":1,"syntology":null},{"paper":null,"title":"Stool Recognition for Colorectal Cancer Detection through Deep Learning","date":"2024-10-19","arxiv_id":"2410.17288","n_code_links":0,"syntology":null},{"paper":"/paper/mm2latent-text-to-facial-image-generation-and","title":"MM2Latent: Text-to-facial image generation and editing in GANs with multimodal assistance","date":"2024-09-17","arxiv_id":"2409.11010","n_code_links":1,"syntology":null},{"paper":null,"title":"Bridging the Gap: Studio-like Avatar Creation from a Monocular Phone Capture","date":"2024-07-28","arxiv_id":"2407.19593","n_code_links":0,"syntology":null},{"paper":"/paper/face-reconstruction-transfer-attack-as-out-of","title":"Face Reconstruction Transfer Attack as Out-of-Distribution Generalization","date":"2024-07-02","arxiv_id":"2407.02403","n_code_links":1,"syntology":null},{"paper":null,"title":"Controlling Face's Frame generation in StyleGAN's latent space operations: Modifying faces to deceive our memory","date":"2024-06-30","arxiv_id":"2407.00803","n_code_links":0,"syntology":null},{"paper":"/paper/analyzing-the-feature-extractor-networks-for","title":"Analyzing the Feature Extractor Networks for Face Image Synthesis","date":"2024-06-04","arxiv_id":"2406.02153","n_code_links":1,"syntology":null},{"paper":null,"title":"Nickel and Diming Your GAN: A Dual-Method Approach to Enhancing GAN Efficiency via Knowledge Distillation","date":"2024-05-19","arxiv_id":"2405.11614","n_code_links":0,"syntology":null},{"paper":null,"title":"Sampling Strategies for Mitigating Bias in Face Synthesis Methods","date":"2024-05-18","arxiv_id":"2405.11320","n_code_links":0,"syntology":null},{"paper":null,"title":"The Impact of Print-Scanning in Heterogeneous Morph Evaluation Scenarios","date":"2024-04-09","arxiv_id":"2404.06559","n_code_links":0,"syntology":null},{"paper":"/paper/latentswap-an-efficient-latent-code-mapping","title":"LatentSwap: An Efficient Latent Code Mapping Framework for Face Swapping","date":"2024-02-28","arxiv_id":"2402.18351","n_code_links":1,"syntology":null},{"paper":null,"title":"Geometry aware 3D generation from in-the-wild images in ImageNet","date":"2024-01-31","arxiv_id":"2402.00225","n_code_links":0,"syntology":null},{"paper":null,"title":"UniHDA: A Unified and Versatile Framework for Multi-Modal Hybrid Domain Adaptation","date":"2024-01-23","arxiv_id":"2401.12596","n_code_links":0,"syntology":null},{"paper":"/paper/huref-human-readable-fingerprint-for-large","title":"HuRef: HUman-REadable Fingerprint for Large Language Models","date":"2023-12-08","arxiv_id":"2312.04828","n_code_links":1,"syntology":{"ran":3,"of":3,"unverified":0,"pointer_only":3}},{"paper":null,"title":"Synthetic Speaking Children -- Why We Need Them and How to Make Them","date":"2023-11-08","arxiv_id":"2311.06307","n_code_links":0,"syntology":null},{"paper":null,"title":"On Measuring Fairness in Generative Models","date":"2023-10-30","arxiv_id":"2310.19297","n_code_links":0,"syntology":null},{"paper":null,"title":"Enhancing the Authenticity of Rendered Portraits with Identity-Consistent Transfer Learning","date":"2023-10-06","arxiv_id":"2310.04194","n_code_links":0,"syntology":null},{"paper":"/paper/fg-net-facial-action-unit-detection-with","title":"FG-Net: Facial Action Unit Detection with Generalizable Pyramidal Features","date":"2023-08-23","arxiv_id":"2308.12380","n_code_links":1,"syntology":null},{"paper":null,"title":"Fair GANs through model rebalancing for extremely imbalanced class distributions","date":"2023-08-16","arxiv_id":"2308.08638","n_code_links":0,"syntology":null},{"paper":null,"title":"ChildGAN: Large Scale Synthetic Child Facial Data Using Domain Adaptation in StyleGAN","date":"2023-07-25","arxiv_id":"2307.13746","n_code_links":0,"syntology":null},{"paper":"/paper/hyperreenact-one-shot-reenactment-via-jointly","title":"HyperReenact: One-Shot Reenactment via Jointly Learning to Refine and Retarget Faces","date":"2023-07-20","arxiv_id":"2307.10797","n_code_links":1,"syntology":{"ran":7,"of":7,"unverified":0,"pointer_only":7}},{"paper":null,"title":"StyleGAN3: Generative Networks for Improving the Equivariance of Translation and Rotation","date":"2023-07-08","arxiv_id":"2307.03898","n_code_links":0,"syntology":null},{"paper":"/paper/seeing-is-not-believing-an-identity-hider-for","title":"Seeing is not Believing: An Identity Hider for Human Vision Privacy Protection","date":"2023-07-02","arxiv_id":"2307.00481","n_code_links":1,"syntology":null},{"paper":null,"title":"Deep Learning for Cancer Prognosis Prediction Using Portrait Photos by StyleGAN Embedding","date":"2023-06-26","arxiv_id":"2306.14596","n_code_links":0,"syntology":null},{"paper":null,"title":"F?D: On understanding the role of deep feature spaces on face generation evaluation","date":"2023-05-31","arxiv_id":"2305.20048","n_code_links":0,"syntology":null},{"paper":null,"title":"BRICS: Bi-level feature Representation of Image CollectionS","date":"2023-05-29","arxiv_id":"2305.18601","n_code_links":0,"syntology":null}],"papers_shown":30,"tasks":[{"task":"/task/image-generation","name":"Image Generation","papers":53},{"task":"/task/attribute","name":"Attribute","papers":20},{"task":null,"name":"Generative Adversarial Network","papers":20},{"task":"/task/image-manipulation","name":"Image Manipulation","papers":14},{"task":"/task/disentanglement","name":"Disentanglement","papers":13},{"task":"/task/face-generation","name":"Face Generation","papers":13},{"task":"/task/diversity","name":"Diversity","papers":11},{"task":"/task/data-augmentation","name":"Data Augmentation","papers":10},{"task":"/task/face-recognition","name":"Face Recognition","papers":10},{"task":"/task/conditional-image-generation","name":"Conditional Image Generation","papers":7},{"task":"/task/translation","name":"Translation","papers":7},{"task":"/task/domain-adaptation","name":"Domain Adaptation","papers":6},{"task":"/task/face-swapping","name":"Face Swapping","papers":6},{"task":"/task/image-to-image-translation","name":"Image-to-Image Translation","papers":5},{"task":"/task/knowledge-distillation","name":"Knowledge Distillation","papers":5},{"task":"/task/transfer-learning","name":"Transfer Learning","papers":5},{"task":"/task/image-reconstruction","name":"Image Reconstruction","papers":4},{"task":"/task/segmentation","name":"Segmentation","papers":4},{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":4},{"task":"/task/style-transfer","name":"Style Transfer","papers":4}],"tasks_shown":20,"n_tasks":139,"usage_by_year":[{"year":"2019","papers":1},{"year":"2020","papers":22},{"year":"2021","papers":52},{"year":"2022","papers":56},{"year":"2023","papers":34},{"year":"2024","papers":15},{"year":"2025","papers":2}],"row_source":"embedded","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/path-length-regularization"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}