
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Available here.
As an example we will create and train a normalizing flow model to toy data in just a few lines of code:
from flowjax.flows import block_neural_autoregressive_flow
from flowjax.train import fit_to_data
from flowjax.distributions import Normal
import jax.random as jr
import jax.numpy as jnp
data_key, flow_key, train_key, sample_key = jr.split(jr.key(0), 4)
x = jr.uniform(data_key, (5000, 2)) # Toy data
flow = block_neural_autoregressive_flow(
key=flow_key,
base_dist=Normal(jnp.zeros(x.shape[1])),
)
flow, losses = fit_to_data(
key=train_key,
dist=flow,
x=x,
learning_rate=5e-3,
max_epochs=200,
)
# We can now evaluate the log-probability of arbitrary points
log_probs = flow.log_prob(x)
# And sample the distribution
samples = flow.sample(sample_key, (1000, ))
The package currently includes:
coupling_flow
(Dinh et al., 2017) and masked_autoregressive_flow
(Kingma et al., 2016, Papamakarios et al., 2017) normalizing flow architectures.
Affine
or RationalQuadraticSpline
(the latter used in neural spline flows; Durkan et al., 2019).block_neural_autoregressive_flow
, as introduced by De Cao et al., 2019.planar_flow
, as introduced by Rezende and Mohamed, 2015.triangular_spline_flow
, introduced here.pip install flowjax
This package is in its early stages of development and may undergo significant changes, including breaking changes, between major releases. Whilst ideally we should be on version 0.y.z to indicate its state, we have already progressed beyond that stage. Any breaking changes will be in the release notes for each major release.
We can install a version for development as follows
git clone https://github.com/danielward27/flowjax.git
cd flowjax
pip install -e .[dev]
sudo apt-get install pandoc # Required for building documentation
If you found this package useful in academic work, please consider citing it using the
template below, filling in [version number]
and [release year of version]
to the
appropriate values. Version specific DOIs
can be obtained from zenodo if desired.
@software{ward2023flowjax,
title = {FlowJAX: Distributions and Normalizing Flows in Jax},
author = {Daniel Ward},
url = {https://github.com/danielward27/flowjax},
version = {[version number]},
year = {[release year of version]},
doi = {10.5281/zenodo.10402073},
}
FAQs
Easy to use distributions, bijections and normalizing flows in JAX.
We found that flowjax demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.