{"id":20525893,"url":"https://github.com/yokaze/swgmm","last_synced_at":"2025-10-07T03:24:33.134Z","repository":{"id":255895136,"uuid":"207576314","full_name":"yokaze/swgmm","owner":"yokaze","description":"Sliced Wasserstein GMM using automatic differentiation","archived":false,"fork":false,"pushed_at":"2019-09-11T14:21:29.000Z","size":130,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T04:34:51.642Z","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/yokaze.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":"2019-09-10T14:05:53.000Z","updated_at":"2022-04-18T02:01:26.000Z","dependencies_parsed_at":"2024-09-07T18:29:24.607Z","dependency_job_id":"1ccb081e-8bbe-444d-8a2c-f61cfca39e16","html_url":"https://github.com/yokaze/swgmm","commit_stats":null,"previous_names":["yokaze/swgmm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yokaze/swgmm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokaze%2Fswgmm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokaze%2Fswgmm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokaze%2Fswgmm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokaze%2Fswgmm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yokaze","download_url":"https://codeload.github.com/yokaze/swgmm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yokaze%2Fswgmm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278714110,"owners_count":26033021,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-15T23:10:52.656Z","updated_at":"2025-10-07T03:24:33.119Z","avatar_url":"https://github.com/yokaze.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sliced Wasserstein GMM\n\nThis repository contains an alternative implementation of \"Sliced Wasserstein Distance for Learning Gaussian Mixture Models\" proposed by Kolouri et., al.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/yokaze/swgmm/blob/master/figures/swgmm.png\" /\u003e\n\u003c/p\u003e\n\nThe figures describe the status of estimation (top-left), transport cost for each observation (middle-left), alignment of empirical and estimated distributions (bottom-left), and the history of estimated sliced Wasserstein distance (right).\nYou get this result in animation by running `swgmm.py`.\n\n**NOTE:** This implementation does not estimate full covariance matrix, instead it only estimates the diagonal components.\nAlso, it applies gradients on the logarithm of unnormalized Gaussian weights and those of diagonal components in covariance matrices. These changes make the implementation easier, at the expense of moderate performance degradation.\n\n## Resources\n\n- Comparison of KL, Wasserstein-1, and Wasserstein-2 distances with respect to the coordinate of the left Gaussian component.\nIt can be seen that KL divergence is suffered from gradient vanishing and a local mimimum, while W1 and W2 distances successfully figure out the global minimum.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/yokaze/swgmm/blob/master/figures/loss.png\" /\u003e\n\u003c/p\u003e\n\n- Illustration of optimal transport alignment between discrete and continuous distributions.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/yokaze/swgmm/blob/master/figures/map.png\" /\u003e\n\u003c/p\u003e\n\n## Requirements\n\n- TensorFlow 2.0\n- R (to retrieve Old Faithful geyser dataset)\n- No GPU is needed, this script runs on a CPU using three minutes\n\n## Reference\n\n- Soheil Kolouri, Gustavo K. Rohde, Heiko Hoffmann, \"Sliced Wasserstein Distance for Learning Gaussian Mixture Models\", in _Proc. CVPR_, 2018, pp. 3427--3436.\u003cbr /\u003e\n  \u003cspan style=\"word-break: break-all;\"\u003e\n  https://arxiv.org/abs/1711.05376\n  \u003c/span\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyokaze%2Fswgmm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyokaze%2Fswgmm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyokaze%2Fswgmm/lists"}