Skip to main content

Tests codecov docs PyPI PyPI - Downloads GPLv3

deep-unfolding: Deep unfolding of iterative methods

The deep-unfolding package includes iterative methods for solving linear equations. However, due to the various parameters and performance characteristics of the iterative approach, it is necessary to optimize these parameters to improve the convergence rate. deep-unfolding takes an iterative algorithm with a fixed number of iterations $T$, unravels its structure, and adds trainable parameters. These parameters are then trained using deep learning techniques such as loss functions, stochastic gradient descent, and backpropagation.

The package contains two different modules containing iterative methods. The first, methods, includes conventional iterative methods. The second, train_methods, includes deep unfolding versions of the conventional methods.

Installation

pip install --upgrade pip
pip install deep-unfolding

Quick start

from deep_unfolding import device, evaluate_model, generate_A_H_sol, SORNet, train_model
from torch import nn, optim

total_itr = 25  # Total number of iterations
n = 300  # Number of rows
m = 600  # Number of columns
bs = 10000  # Mini-batch size (samples)
num_batch = 500  # Number of mini-batches
lr_adam = 0.002  # Learning rate of optimizer
init_val_SORNet = 1.1  # Initial value of omega for SORNet

seed = 12

A, H, W, solution, y = generate_A_H_sol(n=n, m=m, seed=seed, bs=bs)
loss_func = nn.MSELoss()

# Model
model_SorNet = SORNet(A, H, bs, y, init_val_SORNet, device=device)

# Optimizer
opt_SORNet = optim.Adam(model_SorNet.parameters(), lr=lr_adam)

trained_model_SorNet, loss_gen_SORNet = train_model(model_SorNet, opt_SORNet, loss_func, solution, total_itr, num_batch)

norm_list_SORNet = evaluate_model(trained_model_SorNet, solution, n, bs, total_itr, device=device)

Package contents

This package implements various iterative techniques for approximating the solutions of linear problems of the type $Ax = b$. The conventional methods implemented in the methods module are:

  • GS: Gauss-Seidel (GS) algorithm
  • RI: Richardson iteration algorithm
  • Jacobi: Jacobi iteration (RI) algorithm
  • SOR: Successive Over-Relaxation (SOR) algorithm
  • SORCheby: Successive Over-Relaxation (SOR) with Chebyshev acceleration algorithm
  • AOR: Accelerated Over-Relaxation (AOR) algorithm
  • AORCheby: Accelerated Over-Relaxation (AOR) with Chebyshev acceleration algorithm

This package also implements several models based on Deep Unfolding Learning, enabling optimization of the parameters of some of the preceding algorithms to obtain an optimal approximation. The models implemented in the module train_methods are:

  • SORNet: Optimization via Deep Unfolding Learning of the Successive Over-Relaxation (SOR) algorithm
  • SORChebyNet: Optimization via Deep Unfolding Learning of the Successive Over-Relaxation (SOR) with Chebyshev acceleration algorithm
  • AORNet: Optimization via Deep Unfolding Learning of the Accelerated Over-Relaxation (AOR) algorithm
  • RINet: Optimization via Deep Unfolding Learning of the Richardson iteration (RI) algorithm

Reference

If you use this software, please cite the following reference: available soon

License

GPLv3 License

Metadata

Release files for deep-unfolding 0.2.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 deep-unfolding 0.2.0
File Size Uploaded Provenance
deep_unfolding-0.2.0.tar.gz 26.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for deep-unfolding 0.2.0
File Interpreter ABI Platform
deep_unfolding-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.7 kB

Release files / deep_unfolding-0.2.0.tar.gz

Download URL deep_unfolding-0.2.0.tar.gz
Size 26.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d78f267afd5e5f41dbe81ac6b00d33258dd8390fee7f1670dc6d88d80e85e394
BLAKE2b-256 checksum
How to use checksums
bb850db53bb41ab7dba7acc565d23c893dcb577796fbc1477d47b78e92fef827
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / deep_unfolding-0.2.0-py3-none-any.whl

Download URL deep_unfolding-0.2.0-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f7b474d1fce0ed80af4d5365d63352a3e9c40976cdd7b9d3eaf76e40b81f789
BLAKE2b-256 checksum
How to use checksums
eb370350b4df739491a1bfdd183fa28d7a5d41bda34473daaa9c259206a88647
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Security for deep-unfolding 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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