{"id":13784738,"url":"https://github.com/Information-Fusion-Lab-Umass/NuX","last_synced_at":"2025-05-11T20:31:06.524Z","repository":{"id":43226229,"uuid":"245911992","full_name":"Information-Fusion-Lab-Umass/NuX","owner":"Information-Fusion-Lab-Umass","description":"Normalizing Flows using JAX","archived":false,"fork":false,"pushed_at":"2023-11-30T23:00:01.000Z","size":90675,"stargazers_count":83,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-05T21:07:27.754Z","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/Information-Fusion-Lab-Umass.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}},"created_at":"2020-03-09T00:38:49.000Z","updated_at":"2025-03-17T21:39:16.000Z","dependencies_parsed_at":"2023-12-01T00:21:44.335Z","dependency_job_id":"2cf8e6de-d9d2-4a7c-ac32-a88fb248fb5c","html_url":"https://github.com/Information-Fusion-Lab-Umass/NuX","commit_stats":{"total_commits":120,"total_committers":6,"mean_commits":20.0,"dds":"0.15833333333333333","last_synced_commit":"8eff7add34bc04b56d853f4858b71324cdc42dee"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Information-Fusion-Lab-Umass%2FNuX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Information-Fusion-Lab-Umass%2FNuX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Information-Fusion-Lab-Umass%2FNuX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Information-Fusion-Lab-Umass%2FNuX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Information-Fusion-Lab-Umass","download_url":"https://codeload.github.com/Information-Fusion-Lab-Umass/NuX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253631924,"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":[],"created_at":"2024-08-03T19:00:51.929Z","updated_at":"2025-05-11T20:31:06.190Z","avatar_url":"https://github.com/Information-Fusion-Lab-Umass.png","language":"Python","funding_links":[],"categories":["📦 Packages \u003csmall\u003e(15)\u003c/small\u003e","Models and Projects"],"sub_categories":["\u003cimg src=\"assets/jax.svg\" alt=\"JAX\" height=\"20px\"\u003e \u0026nbsp;JAX Packages","Haiku"],"readme":"### Check out an improved version of NuX called [generax](https://github.com/EddieCunningham/generax)!\n\n# NuX - Normalizing Flows using JAX\n\n[![.github/workflows/CI.yml](https://github.com/MilesCranmer/NuX/actions/workflows/CI.yml/badge.svg)](https://github.com/MilesCranmer/NuX/actions/workflows/CI.yml)\n\n## What is NuX?\nNuX is a library for building [normalizing flows](https://arxiv.org/pdf/1912.02762.pdf) using [JAX](https://github.com/google/jax).\n\n## What are normalizing flows?\nNormalizing flows learn a parametric model over an unknown probability density function using data.  We assume that data points are sampled i.i.d. from an unknown distribution p(x).  Normalizing flows learn a parametric approximation of the true data distribution using maximum likelihood learning.  The learned distribution can be efficiently sampled from and has a log likelihood that can be evaluated exactly.\n\n## Why use NuX?\nIt is easy to build, train and evaluate normalizing flows with NuX\n\n```python\nimport jax\nimport jax.numpy as jnp\nimport nux\n\n# Generate some fake data\nrng_key = jax.random.PRNGKey(0)\nbatch_size, dim = 8, 3\nx = jax.random.normal(rng_key, (batch_size, dim))\n\n# Create your normalizing flow\nflow = nux.Sequential([nux.DenseMVP(),\n                       nux.SneakyReLU(),\n                       nux.UnitGaussianPrior()])\n\n# Initialize the flow with data-dependent initialization\nz, log_px = flow(x, rng_key=rng_key)\n\n# Retrieve the initialized parameters from the flow\nparams = flow.get_params()\n\n# Generate samples.  The prior layer will use the input's shape for sampling.\nx_samples, log_px_samples = flow(jnp.zeros_like(x), params=params, inverse=True, rng_key=rng_key)\n\n# Pass the samples to the latent space\nz, log_px = flow(x_samples, params=params, inverse=False)\n\n# Reconstruct the samples\nx_reconstr, log_px_reconstr = flow(z, params=params, inverse=True, reconstruction=True)\n\nassert jnp.allclose(x_samples, x_reconstr)\nassert jnp.allclose(log_px_samples, log_px)\nassert jnp.allclose(log_px, log_px_reconstr)\n```\n\n## Get started\nThe easiest way to use NuX is to clone this repo and install the prerequisites with the \"pip install .\" command.  JAX should be manually installed (see [this](https://github.com/google/jax#installation)) because GPU support is system dependent.  The NuX package available on pip is outdated and does not have much of the functionality of the current code.\n\nNuX is in active development, so expect the API to change over time.  Contributions are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInformation-Fusion-Lab-Umass%2FNuX","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FInformation-Fusion-Lab-Umass%2FNuX","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInformation-Fusion-Lab-Umass%2FNuX/lists"}