{"id":13784429,"url":"https://github.com/matejgrcic/DenseFlow","last_synced_at":"2025-05-11T19:32:57.416Z","repository":{"id":49775023,"uuid":"388720156","full_name":"matejgrcic/DenseFlow","owner":"matejgrcic","description":"Official implementation of Densely connected normalizing flows","archived":false,"fork":false,"pushed_at":"2023-12-17T20:37:16.000Z","size":1861,"stargazers_count":34,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-17T20:48:30.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matejgrcic.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-23T07:46:08.000Z","updated_at":"2024-09-20T05:44:12.000Z","dependencies_parsed_at":"2024-01-17T03:17:22.044Z","dependency_job_id":"32c744fd-181b-4133-abbf-d450371dfd69","html_url":"https://github.com/matejgrcic/DenseFlow","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/matejgrcic%2FDenseFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matejgrcic%2FDenseFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matejgrcic%2FDenseFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matejgrcic%2FDenseFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matejgrcic","download_url":"https://codeload.github.com/matejgrcic/DenseFlow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253621313,"owners_count":21937504,"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":[],"created_at":"2024-08-03T19:00:43.161Z","updated_at":"2025-05-11T19:32:56.952Z","avatar_url":"https://github.com/matejgrcic.png","language":"Python","funding_links":[],"categories":["📝 Publications \u003csmall\u003e(60)\u003c/small\u003e"],"sub_categories":[],"readme":"# Densely connected normalizing flows\n\nThis repository is the official implementation of **NeurIPS 2021** paper [Densely connected normalizing flows](https://arxiv.org/abs/2106.04627).\nPoster available [here](assets/poster_DenseFlow.png).\n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/densely-connected-normalizing-flows/image-generation-on-imagenet-32x32)](https://paperswithcode.com/sota/image-generation-on-imagenet-32x32?p=densely-connected-normalizing-flows)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/densely-connected-normalizing-flows/image-generation-on-imagenet-64x64)](https://paperswithcode.com/sota/image-generation-on-imagenet-64x64?p=densely-connected-normalizing-flows)\n![visitors](https://visitor-badge.laobi.icu/badge?page_id=matejgrcic.DenseFlow)\n\n##  Setup\n\n- CUDA 11.1 \n- Python 3.8\n\n```\npip install -r requirements.txt\npip install -e .\n```\n## Training\n  \n```\ncd ./experiments/image\n```\nCIFAR-10:\n```\npython train.py --epochs 400 --batch_size 64 --optimizer adamax --lr 1e-3  --gamma 0.9975 --warmup 5000  --eval_every 1 --check_every 10 --dataset cifar10 --augmentation eta --block_conf 6 4 1 --layers_conf  5 6 20  --layer_mid_chnls 48 48 48 --growth_rate 10  --name DF_74_10\n```\n```\npython train_more.py --model ./log/cifar10_8bit/densenet-flow/expdecay/DF_74_10 --new_lr 2e-5 --new_epochs 420\n```\nImageNet32:\n```\npython train.py --epochs 20 --batch_size 64 --optimizer adamax --lr 1e-3  --gamma 0.95 --warmup 5000  --eval_every 1 --check_every 10 --dataset imagenet32 --augmentation eta --block_conf 6 4 1 --layers_conf  5 6 20  --layer_mid_chnls 48 48 48 --growth_rate 10  --name DF_74_10\n```\n```\npython train_more.py --model ./log/imagenet32_8bit/densenet-flow/expdecay/DF_74_10 --new_lr 2e-5 --new_epochs 22\n```\nImageNet64:\n```\npython train.py --epochs 10 --batch_size 32 --optimizer adamax --lr 1e-3  --gamma 0.95 --warmup 5000  --eval_every 1 --check_every 10 --dataset imagenet64 --augmentation eta --block_conf 6 4 1 --layers_conf  5 6 20  --layer_mid_chnls 48 48 48 --growth_rate 10  --name DF_74_10\n```\n```\npython train_more.py --model ./log/imagenet64_8bit/densenet-flow/expdecay/DF_74_10 --new_lr 2e-5 --new_epochs 11\n```\nCelebA:\n```\npython train.py --epochs 50 --batch_size 32 --optimizer adamax --lr 1e-3  --gamma 0.95 --warmup 5000  --eval_every 1 --check_every 10 --dataset celeba --augmentation horizontal_flip --block_conf 6 4 1 --layers_conf  5 6 20  --layer_mid_chnls 48 48 48 --growth_rate 10  --name DF_74_10\n```\n```\npython train_more.py --model ./log/celeba_8bit/densenet-flow/expdecay/DF_74_10 --new_lr 2e-5 --new_epochs 55\n```\n**Note:** Download instructions for ImageNet and CelebA are defined in `denseflow/data/datasets/image/{dataset}.py`\n## Evaluation\n\nCIFAR-10:\n```\npython eval_loglik.py --model PATH_TO_MODEL --k 1000 --kbs 50\n```\nImageNet32:\n```\npython eval_loglik.py --model PATH_TO_MODEL --k 200 --kbs 50\n```\nImageNet64 and CelebA:\n```\npython eval_loglik.py --model PATH_TO_MODEL --k 200 --kbs 25\n```\n\n## Model weights\nModel weights are stored [here](https://drive.google.com/file/d/1CAX-TV4ZTtNbb57UYTn6j-rY7CQFpocp/view?usp=sharing).\n\n**Update Dec 2023.** Note that our ImageNet models are trained on the publicly available version of the dataset at https://image-net.org \n\n\n## Samples generation\nGenerated samples are stored in `PATH_TO_MODEL/samples`\n```\npython eval_sample.py --model PATH_TO_MODEL\n```\n**Note:** `PATH_TO_MODEL` has to contain `check` directory.\n\n### ImageNet 32x32\n\n![Alt text](assets/ImageNet32.png?raw=true)\n\n### ImageNet 64x64\n\n![Alt text](assets/ImageNet64.png?raw=true)\n\n### CelebA\n\n![Alt text](assets/CelebA.png?raw=true)\n\n\n### Acknowledgements\nSignificant part of this code benefited from SurVAE [1] [code implementation](https://github.com/didriknielsen/survae_flows), available under MIT license.\n\n\n### References\n[1] Didrik Nielsen, Priyank Jaini, Emiel Hoogeboom, Ole Winther, and Max Welling. Survae flows: Surjections to bridge the gap between vaes and flows. InAdvances in Neural Information Processing Systems 33. Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatejgrcic%2FDenseFlow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatejgrcic%2FDenseFlow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatejgrcic%2FDenseFlow/lists"}