Skip to main content

fastprox

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

  • Exact. Direct algorithms (Condat's 1D TV and simplex projection, the taut string, pool-adjacent-violators) instead of iterative solvers.
  • Differentiable. Jacobian-vector and vector-Jacobian products in the input, the step and the operator's parameters, for bilevel learning and implicit differentiation.
  • 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.

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 (0.1)

Soft thresholding (weighted), elastic net, Huber, group ℓ2, box, nonnegative orthant, ℓ2 ball, simplex, weighted ℓ1 ball, ℓ∞ norm, isotonic regression, and 1D total variation with per-edge weights. Each one has a conjugate prox through the Moreau identity.

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.1.0

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.1.0
File Size Uploaded
fastprox-0.1.0.tar.gz 460.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for fastprox 0.1.0
File
fastprox-0.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
fastprox-0.1.0-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
fastprox-0.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details
fastprox-0.1.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
fastprox-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl CPython 3.12 abi3 macOS 10.15+ x86-64 Details

Total release size: 1.6 MB

Release files / fastprox-0.1.0.tar.gz

Download URL fastprox-0.1.0.tar.gz
Size 460.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3d3499255584e6b024c716aae66252788962704154c0d61c8d4c83cf2f10563c
BLAKE2b-256 checksum
How to use checksums
3aa1876e609a806d1db65c6a9ca401af239b7ad185a751e805ff449bd37a0694
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 16, 2026.

Transparency log

Release files / fastprox-0.1.0-cp312-abi3-win_amd64.whl

Download URL fastprox-0.1.0-cp312-abi3-win_amd64.whl
Size 343.3 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f9fc719081eb8373687c97bab94ee2fb87cee20c3d57502ac846e6b07f73bde6
BLAKE2b-256 checksum
How to use checksums
37e91f3b05e76f697be8ac9985101fb24b18e9ba2271a03ab68bd699fd87e1e7
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 16, 2026.

Transparency log

Release files / fastprox-0.1.0-cp312-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl

Download URL fastprox-0.1.0-cp312-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Size 289.4 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
04592707eb91115282c32cea35fee6c4bf8d0e3973ee00c16afeab111cf06427
BLAKE2b-256 checksum
How to use checksums
410388cd43e472f3ad9b69c49595c6c406e861cac34e6374e3f3fc850a804df5
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 16, 2026.

Transparency log

Release files / fastprox-0.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL fastprox-0.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 270.1 kB
Tags CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
c3eeae240985223746bde15490a53275cea758ecda00e7ba53fd801f156a870d
BLAKE2b-256 checksum
How to use checksums
d5fee6eee1af03b73235cbce2d7c6dacd9a9af8c520fae1e64a9be3b9f47022d
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 16, 2026.

Transparency log

Release files / fastprox-0.1.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL fastprox-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Size 125.1 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
322a201c5a762e7bcf9e54afb010c2161216e562889ce144de515245c1623aae
BLAKE2b-256 checksum
How to use checksums
c3651079897d37f1745ea98fb3a2772fd0fe91d50ff48026c5251bb13568fd4b
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 16, 2026.

Transparency log

Release files / fastprox-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl

Download URL fastprox-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl
Size 151.9 kB
Tags CPython 3.12 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
013c1cd378dfc5120ea681fdc36f90c2e54c00e87d3461b60b4914bd9c85e616
BLAKE2b-256 checksum
How to use checksums
76a37eb9da0a5b6394fd633bff61f30b52b55ddffa244ccb9fb2ad8177287f18
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

6 release files

This release

0.1.0 This release

6 release files

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