{"id":19603914,"url":"https://github.com/divelab/svae","last_synced_at":"2025-04-27T19:32:29.469Z","repository":{"id":107289984,"uuid":"92206272","full_name":"divelab/svae","owner":"divelab","description":"Tensorflow implementation of Spatial VAE via Matrix-Variate Normal Distributions","archived":false,"fork":false,"pushed_at":"2017-05-24T18:32:22.000Z","size":519,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T02:21:46.365Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/divelab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-23T18:29:14.000Z","updated_at":"2024-05-22T20:09:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ac45f88-adc5-4ad4-9b2d-2fe37c428398","html_url":"https://github.com/divelab/svae","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/divelab%2Fsvae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divelab%2Fsvae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divelab%2Fsvae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divelab%2Fsvae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divelab","download_url":"https://codeload.github.com/divelab/svae/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251195931,"owners_count":21550871,"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-11-11T09:33:39.411Z","updated_at":"2025-04-27T19:32:29.458Z","avatar_url":"https://github.com/divelab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spatial VAE via Matrix-Variate Normal Distributions\n\nThis is the tensorflow implementation of our recent work, \"Spatial Variational Auto-Encoding via Matrix-Variate Normal Distributions\". Please check the [paper](https://arxiv.org/abs/1705.06821) for details.\n\n## Introduction\n\nIn this work, we propose spatial VAEs that use latent variables as feature maps of larger size to explicitly capture spatial information. This is achieved by allowing the latent variables to be sampled from matrix-variate normal (MVN) distributions whose parameters are computed from the encoder network.\n\nIf you wish to cite our work, you can use the following bib for now. \n\n```\n@article{wang2017svae,\n  title={Spatial Variational Auto-Encoding via Matrix-Variate Normal\nDistributions},\n  author={Zhengyang Wang and Hao Yuan and Shuiwang Ji},\n  journal={arXiv preprint arXiv:1705.06821},\n  year={2017}\n}\n```\n\n\n## Experimental results:\n1. CelebA dataset\n\n![image](https://github.com/divelab/Spatial-VAE-via-MVND/blob/master/results/celeba_new.png)\n\n2. Cifar dataset\n\n![image](https://github.com/divelab/Spatial-VAE-via-MVND/blob/master/results/cifar_new.png)\n\n\nIn both figures above, the first and second rows shows training images and images generated by the original VAEs. The\nremaining three rows are the results of naïve spatial VAEs, spatial VAEs via MVN distributions and\nspatial VAEs via low-rank MVN distributions, respectively.\n\nFor details of our work, please refer to [Spatial Variational Auto-Encoding via Matrix-Variate Normal Distributions](https://arxiv.org/abs/1705.06821).\n\n\n\n## Datasets:\n\nOur experiments are based on [cifar 10](https://www.cs.toronto.edu/~kriz/cifar.html) and [cropped celebA datasets](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html). We provide data reader for those two datasets. For celebA dataset, please convert it to h5 file first then call the data reader.\n\nYou can use other datasets such as [The Street View House Numbers (SVHN) Dataset](http://ufldl.stanford.edu/housenumbers/) or [LSUN Dataset](http://lsun.cs.princeton.edu/2016/) as well. Just write a simple data reader file. \n\n## How to run it\n\n1. Clone or download this repository to your working directory.\n2. Get the datasets ready.\n3. Set related arguments in main.py. There are two models: vanilla VAE and our Spatial VAE. Set \"model_name\" as 'vanilla' to call tranditional VAE and set as 'low_rank' to call our Spatial VAE.\n4. Call ``` python main.py ``` or  ``` python main.py --action=train ``` to train the model.\n5. If you wish to use \"parzen window\" to evaluate the model, set a checkpoint in arguments for the model to reload and then call ``` python main.py --action=test```.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivelab%2Fsvae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivelab%2Fsvae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivelab%2Fsvae/lists"}