{"id":20663757,"url":"https://github.com/vita-group/gan-lth","last_synced_at":"2025-04-19T15:56:16.489Z","repository":{"id":53147543,"uuid":"329186759","full_name":"VITA-Group/GAN-LTH","owner":"VITA-Group","description":"[ICLR 2021] \"GANs Can Play Lottery Too\" by Xuxi Chen, Zhenyu Zhang, Yongduo Sui, Tianlong Chen ","archived":false,"fork":false,"pushed_at":"2022-02-18T16:57:32.000Z","size":256,"stargazers_count":26,"open_issues_count":0,"forks_count":7,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-29T09:42:08.153Z","etag":null,"topics":["gan","generative-adversarial-network","lottery-ticket-hypothesis","pruning","transfer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VITA-Group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-13T03:49:52.000Z","updated_at":"2025-01-09T23:55:45.000Z","dependencies_parsed_at":"2022-09-13T18:13:05.343Z","dependency_job_id":null,"html_url":"https://github.com/VITA-Group/GAN-LTH","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FGAN-LTH","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FGAN-LTH/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FGAN-LTH/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FGAN-LTH/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VITA-Group","download_url":"https://codeload.github.com/VITA-Group/GAN-LTH/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249731302,"owners_count":21317342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gan","generative-adversarial-network","lottery-ticket-hypothesis","pruning","transfer"],"created_at":"2024-11-16T19:19:41.838Z","updated_at":"2025-04-19T15:56:16.457Z","avatar_url":"https://github.com/VITA-Group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GANs Can Play Lottery Tickets Too\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nCode for this paper [GANs Can Play Lottery Tickets Too](https://openreview.net/forum?id=1AoMhc_9jER).\n## Overview\n\nFor a range of GANs, we can find matching subnetworks at 67%-74% sparsity. We observe that with or without pruning discriminator has a minor effect on the existence and quality of matching subnetworks, while the initialization used in the discriminator plays a significant role.\n\n## Experiment Results\n\nIterative pruning results on SNGAN\n\n![](https://github.com/VITA-Group/GAN-LTH/blob/main/Figs/result.png)\n\n## Requirements\n\n`pytorch==1.4.0`\n`tensorflow-gpu=1.15.0`\n`imageio`\n`scikit-image`\n`tqdm`\n`tensorboardx`\n\n## Command\n\n\n### SNGAN\n\n#### Generate Initial Weights\n```\nmkdir initial_weights\npython generate_initial_weights.py --model sngan_cifar10\n```\n#### Prepare FID statistics\n\nDownload FID statistics files from [here](https://www.dropbox.com/sh/8xhqxsxnsto18im/AAAkDr-Zf3sgXx1A7RAhlqcva?dl=0) to `fid_stat`. \n\n#### Baseline\n```\npython train.py --model sngan_cifar10 --exp_name sngan_cifar10 --init-path initial_weights\n```\n\nBaseline models are also available [here](https://drive.google.com/drive/folders/1-QSfRrVpHSrHppmEf8fuAUn6Nv-N2z2R?usp=sharing). \n\n\n#### Iterative Magnitude Pruning on Generator (IMPG)\n```\npython train_impg.py --model sngan_cifar10 --exp_name sngan_cifar10 --init-path initial_weights --load-path \u003cpath/to/log\u003e \n```\n#### Iterative Magnitude Pruning on Generator (IMPGD)\n```\npython train_impgd.py --model sngan_cifar10 --exp_name sngan_cifar10 --init-path initial_weights \n```\n### Iterative Magnitude Pruning on Generator (IMPGDKD)\n\n```\npython train_impgd.py --model sngan_cifar10 --exp_name sngan_cifar10 --init-path initial_weights --use-kd-d\n```\n\n### CycleGAN\n\n#### Generate initial weights\n\n```\nmkdir initial_weights\npython generate_initial_weights.py\n```\n\n#### Download Data\n\n```\n./download_dataset DATASET_NAME\n```\n#### Baseline\n\n```\npython train.py --dataset DATASET_NAME --rand initial_weights --gpu GPU \n```\n\n#### IMPG\n\n```\npython train_impg.py --dataset DATASET_NAME --rand initial_weights --gpu GPU --pretrain PRETRAIN\n```\n\n#### IMPGD\n\n```\npython train_impg.py --dataset DATASET_NAME --rand initial_weights --gpu GPU --pretrain PRETRAIN\n```\n\n## Acknowledgement\n\nInception Score code from OpenAI's Improved GAN (official), and the FID code and CIFAR-10 statistics file from https://github.com/bioinf-jku/TTUR (official).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvita-group%2Fgan-lth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvita-group%2Fgan-lth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvita-group%2Fgan-lth/lists"}