{"id":13784623,"url":"https://github.com/thoglu/jammy_flows","last_synced_at":"2025-05-11T20:30:52.766Z","repository":{"id":59135449,"uuid":"332748484","full_name":"thoglu/jammy_flows","owner":"thoglu","description":"A package to describe amortized (conditional) normalizing-flow PDFs defined jointly on tensor products of manifolds with coverage control. The connection between different manifolds is fixed via an autoregressive structure.","archived":false,"fork":false,"pushed_at":"2025-03-27T13:26:39.000Z","size":8921,"stargazers_count":43,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-27T14:27:45.363Z","etag":null,"topics":["manifolds","normalizing-flows","pdf","probability-distribution"],"latest_commit_sha":null,"homepage":"","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/thoglu.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-25T13:01:02.000Z","updated_at":"2025-03-27T13:23:17.000Z","dependencies_parsed_at":"2023-10-11T00:47:54.993Z","dependency_job_id":"8d41c502-6547-44fe-b8a8-75f099040b89","html_url":"https://github.com/thoglu/jammy_flows","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoglu%2Fjammy_flows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoglu%2Fjammy_flows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoglu%2Fjammy_flows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoglu%2Fjammy_flows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoglu","download_url":"https://codeload.github.com/thoglu/jammy_flows/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253631915,"owners_count":21939368,"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":["manifolds","normalizing-flows","pdf","probability-distribution"],"created_at":"2024-08-03T19:00:49.669Z","updated_at":"2025-05-11T20:30:52.228Z","avatar_url":"https://github.com/thoglu.png","language":"Python","funding_links":[],"categories":["📦 Packages \u003csmall\u003e(15)\u003c/small\u003e"],"sub_categories":["\u003cimg src=\"assets/pytorch.svg\" alt=\"PyTorch\" height=\"20px\"\u003e \u0026nbsp;PyTorch Packages"],"readme":"# jammy_flows\n\n\u003cimg src=\"https://github.com/thoglu/jammy_flows/workflows/build/badge.svg\"\u003e \u003cimg src=\"https://github.com/thoglu/jammy_flows/workflows/tests/badge.svg\"\u003e\n\nThis package implements (conditional) PDFs with **J**oint **A**utoregressive **M**anifold (**MY**) normalizing-flows. It grew out of work for the paper [Unifying supervised learning and VAEs - coverage, systematics and goodness-of-fit in normalizing-flow based neural network models for astro-particle reconstructions [arXiv:2008.05825]](https://arxiv.org/abs/2008.05825) and includes the paper's described methodology for coverage calculation of PDFs on tensor products of manifolds. For Euclidean manifolds, it includes an updated implementation of the [offical implementation](https://github.com/chenlin9/Gaussianization_Flows) of [Gaussianization flows [arXiv:2003.01941]](https://arxiv.org/abs/2003.01941), where now the inverse is differentiable (adding Newton iterations to the bisection) and made more stable using better approximations of the inverse Gaussian CDF. Several other state-of-the art flows are implemented sometimes using slight modifications or extensions.\n\nThe package has a simple syntax that lets the user define a PDF and get going with a single line of code that **should just work**. To define a 10-d PDF, with 4 Euclidean dimensions, followed by a 2-sphere, followed again by 4 Euclidean dimensions, one could for example write\n```\nimport jammy_flows\n\npdf=jammy_flows.pdf(\"e4+s2+e4\", \"gggg+n+gggg\")\n```\nThe first argument describes the manifold structure, the second argument the flow layers for a particular manifold. Here **\"g\"** and **\"n\"** stand for particular normalizing flow layers that are pre-implemented (see **Features** below). The Euclidean parts in this example use 4 **\"g\"** layers each.\n\u003cimg src=\"animation.gif\" alt=\"drawing\" width=\"800\"/\u003e\n\nHave a look at the [script](examples/jammy_flows.py) that generates the above animation.\n\n### Documentation\n\nThe docs can be found [here](https://thoglu.github.io/jammy_flows/index.html).\n\nAlso check out the [example notebook](examples/examples.ipynb).\n\n## Features\n\n### General\n\n- [x] Autoregressive conditional structure is taken care of behind the scenes and connects manifolds\n- [x] Coverage is straightforward. Everything (including spherical, interval and simplex flows) is based on a Gaussian base distribution ([arXiv:2008.0582](https://arxiv.org/abs/2008.05825)).\n- [x] Bisection \u0026 Newton iterations for differentiable inverse (used for certain non-analytic inverse flow functions)\n- [x] amortizable MLPs that can use low-rank approximations\n- [x] amortizable PDFs - the total PDF can be the output of another neural network\n- [x] unit tests that make sure backwards / and forward flow passes of all implemented flow-layers agree \n- [x] include log-lambda as an additional flow parameter to define parametrized Poisson-Processes\n- [x] easily extendible: define new Euclidean / spherical flow layers by subclassing Euclidean or spherical base classes\n\n### Euclidean flows:\n\n- [x] Generic affine flow (Multivariate normal distribution) (**\"t\"**)\n- [x] Gaussianization flow [arXiv:2003.01941](https://arxiv.org/abs/2003.01941) (**\"g\"**)\n- [x] Hybrid of nonlinear scalings and rotations (\"Polynomial Stretch flow\") (**\"p\"**)\n\n### Spherical flows:\n\n### S1:\n- [x] Moebius transformations  (described in [arXiv:2002.02428](https://arxiv.org/abs/2002.02428)) (**\"m\"**)\n- [x] Circular rational-quadratic splines  (described in [arXiv:2002.02428](https://arxiv.org/abs/2002.02428)) (**\"o\"**)\n\n### S2:\n- [x] Autorregressive flow for N-Spheres ([arXiv:2002.02428](https://arxiv.org/abs/2002.02428)) (**\"n\"**)\n- [x] Exponential map flow ([arXiv:0906.0874](https://arxiv.org/abs/0906.0874)/[arXiv:2002.02428](https://arxiv.org/abs/2002.02428)) (**\"v\"**)\n- [x] Neural Manifold Ordinary Differential Equations [arXiv:2006.10254](https://arxiv.org/abs/2006.10254) (**\"c\"**)\n \n### Interval Flows:\n\n- [x] \"Neural Spline Flows\" (Rational-quadratic splines) [arXiv:1906.04032](https://arxiv.org/abs/1906.04032) (**\"r\"**)\n\n### Simplex Flows:\n\n- [x] Autoregressive simplex flow [arXiv:2008.05456](https://arxiv.org/abs/2008.05456) (**\"w\"**)\n\nFor a description of all flows and abbreviations, have a look in the docs [here](https://thoglu.github.io/jammy_flows/usage/api.html#module-jammy_flows.layers.layer_base).\n\n## Requirements\n\n- pytorch (\u003e=1.7)\n- numpy (\u003e=1.18.5)\n- scipy (\u003e=1.5.4)\n- matplotlib (\u003e=3.3.3)\n- torchdiffeq (\u003e=0.2.1)\n\nThe package has been built and tested with these versions, but might work just fine with older ones.\n\n## Installation\n\n### specific version:\n\n```\npip install git+https://github.com/thoglu/jammy_flows.git@*tag* \n```\ne.g.\n```\npip install git+https://github.com/thoglu/jammy_flows.git@1.0.0\n```\nto install release 1.0.0.\n\n### master:\n\n```\npip install git+https://github.com/thoglu/jammy_flows.git\n```\n## Contributions\n\nIf you want to implement your own layer or have bug / feature suggestions, just file an issue.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoglu%2Fjammy_flows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoglu%2Fjammy_flows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoglu%2Fjammy_flows/lists"}