Research repo for convex-structured neural fixed-point solvers for inverse problems.
- Convex ICNN regularizer with hard convexity constraints
- Proximal-gradient fixed-point solver
- Generic Krasnoselskii-Mann fixed-point iterator
- Unit tests checking convexity, prox residual behavior, and convergence on least-squares tasks
- For convex composite objectives with
alpha in (0, 1 / L_f], proximal-gradient has standard convergence guarantees. - This repo uses inexact prox solves in practice; solver traces expose residual and objective behavior for diagnostics.
- Differentiable unrolled training keeps updates smooth for backprop and may disable non-smooth safeguards used in inference mode.
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
pytestsource .venv/bin/activate
fplab-demo --dim 32 --iters 30 --lam 0.1Try accelerated fixed-point updates:
fplab-demo --dim 32 --iters 30 --lam 0.1 --solver fistaTry robust proximal-gradient with backtracking from an aggressive initial step:
fplab-demo --dim 32 --iters 30 --solver pg --alpha-scale 6.0 --line-searchsource .venv/bin/activate
fplab-train-synth --dim 32 --operator blur --solver-iters 6 --prox-iters 60 --train-steps 80Train with accelerated iterations:
fplab-train-synth --dim 32 --operator blur --solver fista --solver-iters 6 --prox-iters 60 --train-steps 80Use --fixed-batch to quickly sanity-check that the optimization loop can overfit one batch.
Use --save-path checkpoints/run.pt to save learned parameters and run metadata.
Use --deterministic for stricter reproducibility.
source .venv/bin/activate
fplab-benchmark-ops --dim 16 --train-steps 20 --operators identity,random,blurBenchmark with the accelerated solver:
fplab-benchmark-ops --dim 16 --train-steps 20 --solver fista --operators identity,random,blursource .venv/bin/activate
fplab-benchmark-solvers --dim 16 --iters 20 --trials 3 --operators identity,random,blurThis writes a markdown table report to reports/solver_benchmark.md by default.
Use --report-path <path> to choose a different output file.
Run against local real samples (image-folder mode):
fplab-benchmark-solvers \
--dataset image_folder \
--data-root /path/to/local/images_or_pt_tensors \
--patch-size 16 \
--num-images 64 \
--iters 20 \
--trials 3 \
--operators identity,random,blurimage_folder mode accepts common image files (png/jpg/...) and .pt/.pth tensors.
It samples random patches, flattens them, and applies the same linear inverse operators.
Use the new FixedPointLayer module for NN-style integration of the solver.
import torch
from fplab.layers import FixedPointLayer, FixedPointLayerConfig
from fplab.models.icnn import ICNNConfig, ICNNRegularizer
from fplab.operators.fidelity import LeastSquaresFidelity
from fplab.prox.prox_icnn import ICNNProxSolver, ProxConfig
layer = FixedPointLayer(
fidelity=LeastSquaresFidelity(A=torch.eye(6)),
regularizer=ICNNRegularizer(ICNNConfig(input_dim=6, hidden_dims=(16, 16), mu_quadratic=1e-2)),
prox_solver=ICNNProxSolver(ProxConfig(max_iters=20, lr=5e-2)),
config=FixedPointLayerConfig(solver="pg", max_iter=6, differentiable=True),
lam=0.1,
)
y = torch.randn(4, 6)
x_hat = layer(y)FixedPointLayer(..., return_trace=True) returns (x_hat, trace) with per-iteration diagnostics.