{"id":13870032,"url":"https://github.com/riannevdberg/sylvester-flows","last_synced_at":"2025-07-15T20:31:19.689Z","repository":{"id":97808382,"uuid":"144337311","full_name":"riannevdberg/sylvester-flows","owner":"riannevdberg","description":null,"archived":false,"fork":false,"pushed_at":"2019-07-05T11:47:53.000Z","size":4953,"stargazers_count":177,"open_issues_count":2,"forks_count":32,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-06T21:22:57.557Z","etag":null,"topics":["deep-learning","normalizing-flows","pytorch","vae"],"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/riannevdberg.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":"2018-08-10T22:23:55.000Z","updated_at":"2024-07-05T13:22:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f2a944c-0327-4383-ae2b-6a7cb74f5153","html_url":"https://github.com/riannevdberg/sylvester-flows","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riannevdberg%2Fsylvester-flows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riannevdberg%2Fsylvester-flows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riannevdberg%2Fsylvester-flows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riannevdberg%2Fsylvester-flows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riannevdberg","download_url":"https://codeload.github.com/riannevdberg/sylvester-flows/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226068162,"owners_count":17568706,"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":["deep-learning","normalizing-flows","pytorch","vae"],"created_at":"2024-08-05T20:01:26.073Z","updated_at":"2024-11-23T16:31:03.317Z","avatar_url":"https://github.com/riannevdberg.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Sylvester normalizing flows for variational inference\n\nPytorch implementation of Sylvester normalizing flows, based on our paper:\n\n[Sylvester normalizing flows for variational inference](https://arxiv.org/abs/1803.05649) (UAI 2018) \u003cbr/\u003e\nRianne van den Berg*, Leonard Hasenclever*, Jakub Tomczak, Max Welling \n\n*Equal contribution\n\n## Requirements\nThe latest release of the code is compatible with:\n\n  * `pytorch 1.0.0`\n\n  * `python 3.7`\n\nThanks to Martin Engelcke for adapting the code\tto provide this compatibility.\n\u003cbr/\u003e\n\nVersion v0.3.0_2.7 is compatible with:\n  \n  * `pytorch 0.3.0` **WARNING**: More recent versions of pytorch have different default flags for the binary cross entropy loss module: nn.BCELoss(). You have to adapt the appropriate flags if you want to port this code to a later vers\\\nion.\n\n  * `python 2.7`\n\n\n## Data\nThe experiments can be run on the following datasets:\n* static MNIST: dataset is in data folder;\n* OMNIGLOT: the dataset can be downloaded from [link](https://github.com/yburda/iwae/blob/master/datasets/OMNIGLOT/chardata.mat);\n* Caltech 101 Silhouettes: the dataset can be downloaded from [link](https://people.cs.umass.edu/~marlin/data/caltech101_silhouettes_28_split1.mat).\n* Frey Faces: the dataset can be downloaded from [link](https://github.com/y0ast/Variational-Autoencoder/blob/master/freyfaces.pkl).\n\n## Usage\n\nBelow, example commands are given for running experiments on static MNIST with different types of Sylvester normalizing flows, for 4 flows:\n\n**Orthogonal Sylvester flows** \u003cbr/\u003e\nThis example uses a bottleneck of size 8 (Q has 8 columns containing orthonormal vectors).\n```bash\npython main_experiment.py -d mnist -nf 4 --flow orthogonal --num_ortho_vecs 8 \n```\n\n**Householder Sylvester flows**\u003cbr/\u003e\nThis example uses 8 Householder reflections per orthogonal matrix Q.\n```bash\npython main_experiment.py -d mnist -nf 4 --flow householder --num_householder 8\n```\n\n**Triangular Sylvester flows**\u003cbr/\u003e\n```bash\npython main_experiment.py -d mnist -nf 4 --flow triangular \n```\n\n\u003cbr/\u003e\nTo run an experiment with other types of normalizing flows or just with a factorized Gaussian posterior, see below.\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n**Factorized Gaussian posterior**\u003cbr/\u003e\n```bash\npython main_experiment.py -d mnist --flow no_flow\n```\n\n**Planar flows**\u003cbr/\u003e\n```bash\npython main_experiment.py -d mnist -nf 4 --flow planar\n```\n\n**Inverse Autoregressive flows**\u003cbr/\u003e\nThis examples uses MADEs with 320 hidden units.\n```bash\npython main_experiment.py -d mnist -nf 4 --flow iaf --made_h_size 320\n```\n\n\u003cbr/\u003e\nMore information about additional argument options can be found by running ```python main_experiment.py -h```\n\n\n## Cite\n\nPlease cite our paper if you use this code in your own work:\n\n```\n@inproceedings{vdberg2018sylvester,\n  title={Sylvester normalizing flows for variational inference},\n  author={van den Berg, Rianne and Hasenclever, Leonard and Tomczak, Jakub and Welling, Max},\n  booktitle={proceedings of the Conference on Uncertainty in Artificial Intelligence (UAI)},\n  year={2018}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friannevdberg%2Fsylvester-flows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friannevdberg%2Fsylvester-flows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friannevdberg%2Fsylvester-flows/lists"}