Dynamic optimal transport on sparse reversible graphs in JAX
Project description
JGOT (JAX Graph Optimal Transport)
jgot solves two-endpoint dynamic optimal transport on sparse reversible graphs
using JAX, following the time-discrete formulation of
Erbar et al. (2020).
Install
PyPI package:
Core library:
pip install jgot
Examples (plotting dependencies included):
pip install "jgot[examples]"
Development environment:
uv sync --group dev
Minimal Example
import jax.numpy as jnp
from jgot import (
GraphSpec,
LogMeanOps,
OTConfig,
OTProblem,
TimeDiscretization,
solve_ot,
)
graph = GraphSpec.from_undirected_weights(
num_nodes=2,
edge_u=[0],
edge_v=[1],
weight=[1.0],
)
mass_a = jnp.array([1.0, 0.0])
mass_b = jnp.array([0.0, 1.0])
rho_a = mass_a / graph.pi
rho_b = mass_b / graph.pi
problem = OTProblem(
graph=graph,
time=TimeDiscretization(num_steps=64),
rho_a=rho_a,
rho_b=rho_b,
mean_ops=LogMeanOps(),
)
sol = solve_ot(problem, OTConfig())
print(float(sol.distance), sol.converged, sol.iterations_used)
Important:
- Densities are represented with respect to
pi. - Endpoints must satisfy
sum(pi * rho) == 1.
Documentation
Detailed docs live under docs.
Recommended starting points:
- Getting Started
- Graph Model
- API Reference
- Examples Guide
- Debugging and Diagnostics
- Numerical Limitations
Examples
Runnable scripts:
examples/two_node_benchmark/run.pyexamples/cycle_neighbor_transport/run.pyexamples/line_chain_transport/run.pyexamples/directed_reversible_transport/run.pyexamples/large_grid_transport/run.py
See examples/README.md for commands and outputs.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jgot-0.2.2.tar.gz.
File metadata
- Download URL: jgot-0.2.2.tar.gz
- Upload date:
- Size: 111.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed2de55d0ffce66ab1e56b2c47fd92edf061e90a62fe22872d939a51489484b9
|
|
| MD5 |
8cd5340b165dfdde7da2c77bde37ece5
|
|
| BLAKE2b-256 |
3fdd6d440b00fa430ff4db89c27b4593bafd2715abe2928754a87c6c28d851e0
|
Provenance
The following attestation bundles were made for jgot-0.2.2.tar.gz:
Publisher:
publish.yml on LvDAO/JaxGraphOT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jgot-0.2.2.tar.gz -
Subject digest:
ed2de55d0ffce66ab1e56b2c47fd92edf061e90a62fe22872d939a51489484b9 - Sigstore transparency entry: 1049555256
- Sigstore integration time:
-
Permalink:
LvDAO/JaxGraphOT@bace17945cdf99a3910d7f0c2f2a11e68598d93e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LvDAO
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bace17945cdf99a3910d7f0c2f2a11e68598d93e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file jgot-0.2.2-py3-none-any.whl.
File metadata
- Download URL: jgot-0.2.2-py3-none-any.whl
- Upload date:
- Size: 29.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b89940357e4c0629c655b83d99be06ca73d2faee8458f926c793ee56145824f5
|
|
| MD5 |
d0945d068116fea2aa0f295f2d6ae99f
|
|
| BLAKE2b-256 |
75d14e9b352aded0b84f8004b3c0c87c3ac230d9b913a392545e917c92b5128a
|
Provenance
The following attestation bundles were made for jgot-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on LvDAO/JaxGraphOT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jgot-0.2.2-py3-none-any.whl -
Subject digest:
b89940357e4c0629c655b83d99be06ca73d2faee8458f926c793ee56145824f5 - Sigstore transparency entry: 1049555263
- Sigstore integration time:
-
Permalink:
LvDAO/JaxGraphOT@bace17945cdf99a3910d7f0c2f2a11e68598d93e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LvDAO
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bace17945cdf99a3910d7f0c2f2a11e68598d93e -
Trigger Event:
workflow_dispatch
-
Statement type: