Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

fastprox

Exact proximal operators and projections with derivatives. A C++17 core behind a plain-C API, with Python bindings.

  • Exact or certified. Direct algorithms (Condat's 1D TV and simplex projection, the taut string, pool-adjacent-violators, closed forms) where they exist. The image TV solvers stop on a certified duality gap, and anisotropic TV is polished to the exact solution once its regions are found.
  • Differentiable. Jacobian-vector and vector-Jacobian products in the input, the step and the operator's parameters, for bilevel learning and implicit differentiation, also inside PyTorch and JAX programs (fastprox.torch, fastprox.jax, since 0.3).
  • Batched. Applied along any axis of a float32 or float64 array, with rows processed in parallel on fastprox's own threads (no OpenMP runtime to clash with PyTorch or others) and results bit-identical for any number of threads.
  • Permissive. MIT licensed; every kernel is written from the papers.

Install

pip install fastprox

Wheels are abi3 for CPython 3.12 and later on Linux (x86_64, aarch64), macOS (arm64 from 11.0, x86_64 from 10.15) and Windows (amd64), and depend on nothing but NumPy. The 0.3 release candidate (graph TV, the PyTorch and JAX wrappers, image TV on GPUs) installs with pip install --pre fastprox; PyTorch and JAX are used when installed, never required.

Use

import numpy as np
import fastprox as fp

x = np.random.default_rng(0).normal(size=(64, 1000))

z = fp.tv1d(x, gamma=0.5)                 # 1D total variation along the last axis
p = fp.project_simplex(x, radius=1.0)     # each row onto the simplex
s = fp.soft_threshold(x, lam=0.1)

# Operators with derivatives
op = fp.TV1D(weights=0.8)
z, ctx = op.prox(x, 0.5, keep=True)
dz = op.jvp(ctx, dx=np.ones_like(x))      # Jacobian-vector product
gx, grads = op.vjp(ctx, g=x)              # vector-Jacobian product
print(grads.gamma, grads.weights)         # gradients in the step and the weights

Operators

  • Elementwise: soft thresholding (weighted), elastic net, Huber, box, nonnegative orthant, log barrier, ℓ1 over a box.
  • Nonconvex: ℓ0, ℓq (0 < q < 1), SCAD and MCP (weighted), log penalty, with an explicit tie rule.
  • Groups and trees: group ℓ2, group Huber, group SCAD and MCP, tree-structured group norms and the sparse group lasso.
  • Projections: ℓ2 ball, simplex, weighted ℓ1 ball, hyperplane or half-space intersected with a box, second-order cone. Also the ℓ∞ norm and the support functions max and the sum of the k largest entries.
  • Signals: isotonic regression, 1D total variation with per-edge weights, its ℓ2-of-differences variant, and the projection onto a 1D TV ball.
  • Images: anisotropic and isotropic total variation in 2D and 3D, with warm starts (since 0.2), also on GPUs through the PyTorch and JAX wrappers (since 0.3).
  • Graphs: total variation on any graph, exact, by parametric max-flow, and on trees and paths by dynamic programming (since 0.3).

Each one has a conjugate prox through the Moreau identity. The elementwise maps with kinks report which entries sit at a breakpoint, and their derivatives can be taken on either side of it.

Documentation

C library

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build && cmake --install build --prefix /usr/local

Then find_package(fastprox) and link fastprox::fastprox, or use pkg-config --cflags --libs fastprox. The header is include/fastprox.h.

License

MIT

Metadata

Release files for fastprox 0.3.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastprox 0.3.0rc1
File Size Uploaded Provenance Actions
fastprox-0.3.0rc1.tar.gz 968.6 kB With provenance Details for fastprox-0.3.0rc1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fastprox 0.3.0rc1
File Actions
fastprox-0.3.0rc1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for fastprox-0.3.0rc1-cp312-abi3-win_amd64.whl
fastprox-0.3.0rc1-cp312-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.26+ x86-64, Linux glibc 2.28+ x86-64 Details for fastprox-0.3.0rc1-cp312-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
fastprox-0.3.0rc1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details for fastprox-0.3.0rc1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
fastprox-0.3.0rc1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for fastprox-0.3.0rc1-cp312-abi3-macosx_11_0_arm64.whl
fastprox-0.3.0rc1-cp312-abi3-macosx_10_15_x86_64.whl CPython 3.12 abi3 macOS 10.15+ x86-64 Details for fastprox-0.3.0rc1-cp312-abi3-macosx_10_15_x86_64.whl

Total release size: 3.5 MB

Release files / fastprox-0.3.0rc1.tar.gz

Download URL fastprox-0.3.0rc1.tar.gz
Size 968.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b6aaa571a94db2795b4d81a43813fd73b4cd308fd085328b0c630cbed7f75f15
BLAKE2b-256 checksum
How to use checksums
67baf1e6a31c46ae9f7b78ca65ec119007f61c88089d0fda0afe36154b1da10d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / fastprox-0.3.0rc1-cp312-abi3-win_amd64.whl

Download URL fastprox-0.3.0rc1-cp312-abi3-win_amd64.whl
Size 566.1 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8eaa333f00311d8f286b1e3928a477acf84cb03e337135ece12436746692232a
BLAKE2b-256 checksum
How to use checksums
a59648364d4c93022d8f9eaa6641ee41a35adc199f1727019a96d85cf2cd56e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / fastprox-0.3.0rc1-cp312-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL fastprox-0.3.0rc1-cp312-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 646.7 kB
Tags CPython 3.12 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
0810164aed74c748151c48ef30e06a376709244df8c80c33266d3d93b712a07d
BLAKE2b-256 checksum
How to use checksums
7eceb1322d64a3cab675ab3a91deb2d6b9aaf569f6d5cf2bdb4ce7566b66b082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / fastprox-0.3.0rc1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL fastprox-0.3.0rc1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 579.7 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
968dd42b80adde150c1418edade66c0a8c58b6e363c793ce6cce0c954456c93d
BLAKE2b-256 checksum
How to use checksums
0c2b9b4b419b3f909bae50e27c54f171086726664eeb43230cfca3140c1637a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / fastprox-0.3.0rc1-cp312-abi3-macosx_11_0_arm64.whl

Download URL fastprox-0.3.0rc1-cp312-abi3-macosx_11_0_arm64.whl
Size 344.0 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fa8678ab40389b97ac4ee3faa580d862a7bbd111ea3566d17bc42f3bea560fae
BLAKE2b-256 checksum
How to use checksums
47fe20e00f0705410a378a74e2be8bdba97dc9d4d9ab9984fe2eb9ada6efb353
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / fastprox-0.3.0rc1-cp312-abi3-macosx_10_15_x86_64.whl

Download URL fastprox-0.3.0rc1-cp312-abi3-macosx_10_15_x86_64.whl
Size 439.2 kB
Tags CPython 3.12 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
0f658584463a1142ef1142f8082ead83ca712b4dbf0167a860446c19de995486
BLAKE2b-256 checksum
How to use checksums
b668c891f1ee54cec7a58dd0a09f113ffe00543696e0b268b4d0eb7f070bebf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Security for fastprox 0.3.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for fastprox-0.3.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page