{"id":13870011,"url":"https://github.com/bayesiains/nsf","last_synced_at":"2025-07-15T20:31:03.144Z","repository":{"id":53458319,"uuid":"191172404","full_name":"bayesiains/nsf","owner":"bayesiains","description":"Code for Neural Spline Flows paper","archived":false,"fork":false,"pushed_at":"2020-06-20T08:49:06.000Z","size":145,"stargazers_count":254,"open_issues_count":5,"forks_count":42,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-06T21:22:56.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bayesiains.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-10T13:21:58.000Z","updated_at":"2024-08-06T09:51:31.000Z","dependencies_parsed_at":"2022-08-30T06:10:52.022Z","dependency_job_id":null,"html_url":"https://github.com/bayesiains/nsf","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/bayesiains%2Fnsf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayesiains%2Fnsf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayesiains%2Fnsf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayesiains%2Fnsf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bayesiains","download_url":"https://codeload.github.com/bayesiains/nsf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226068142,"owners_count":17568703,"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-05T20:01:25.428Z","updated_at":"2024-11-23T16:30:57.741Z","avatar_url":"https://github.com/bayesiains.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Neural Spline Flows\n\nA record of the code and experiments for the paper:\n\n\u003e C. Durkan, A. Bekasov, I. Murray, G. Papamakarios, _Neural Spline Flows_, NeurIPS 2019.\n\u003e [[arXiv]](https://arxiv.org/abs/1906.04032) [[bibtex]](https://gpapamak.github.io/bibtex/neural_spline_flows.bib)\n\nWork in this repository has now stopped. Please go to [nflows](https://github.com/bayesiains/nflows) for an updated and pip-installable normalizing flows framework for PyTorch.\n\n## Dependencies\n\nSee `environment.yml` for required Conda/pip packages, or use this to create a Conda environment with \nall dependencies:\n```bash\nconda env create -f environment.yml\n```\n\nTested with Python 3.5 and PyTorch 1.1.\n\n## Data\n\nData for density-estimation experiments is available at https://zenodo.org/record/1161203#.Wmtf_XVl8eN.\n\nData for VAE and image-modeling experiments is downloaded automatically using either `torchvision` or custom \ndata providers.\n\n## Usage\n\n`DATAROOT` environment variable needs to be set before running experiments.\n\n### 2D toy density experiments\n\nUse `experiments/face.py` or `experiments/plane.py`.\n\n### Density-estimation experiments\n\nUse `experiments/uci.py`.\n\n### VAE experiments\n\nUse `experiments/vae_.py`.\n\n### Image-modeling experiments\n\nUse `experiments/images.py`.\n\n[Sacred](https://github.com/IDSIA/sacred) is used to organize image experiments. See the \n[documentation](http://sacred.readthedocs.org) for more information.\n\n`experiments/image_configs` contains .json configurations used for RQ-NSF (C) experiments. For baseline experiments use `coupling_layer_type='affine'`.\n\nFor example, to run RQ-NSF (C) on CIFAR-10 8-bit:\n```bash\npython experiments/images.py with experiments/image_configs/cifar-10-8bit.json\n```\n\nCorresponding affine baseline run:\n```bash\npython experiments/images.py with experiments/image_configs/cifar-10-8bit.json coupling_layer_type='affine'\n```\n\nTo evaluate on the test set:\n```bash\npython experiments/images.py eval_on_test with experiments/image_configs/cifar-10-8bit.json flow_checkpoint='\u003csaved_checkpoint\u003e'\n```\n\nTo sample:\n```bash\npython experiments/images.py sample with experiments/image_configs/cifar-10-8bit.json flow_checkpoint='\u003csaved_checkpoint\u003e'\n```\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayesiains%2Fnsf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbayesiains%2Fnsf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayesiains%2Fnsf/lists"}