Skip to main content

An Object-Oriented Optimization Framework for Large-Scale Inverse Problems

Project description

occamypy

OccamyPy: an object-oriented optimization framework for small- and large-scale problems

We present an object-oriented optimization framework that can be employed to solve small- and large-scale problems based on the concept of vectors and operators. By using such a strategy, we implement different iterative optimization algorithms that can be used in combination with architecture-independent vectors and operators, allowing the minimization of single-machine or cluster-based problems with a unique codebase. We implement a Python library following the described structure with a user-friendly interface. We demonstrate its flexibility and scalability on multiple inverse problems, where convex and non-convex objective functions are optimized with different iterative algorithms.

Installation

Preferred way is through Python Package Index:

pip install occamypy

In order to have Cupy-based vectors and operators, you should install also Cupy and cuSIGNAL. They are not included in this installation as they are dependent on the target CUDA device and compiler.

As this library strongly relies on Numpy, we suggest installing OccamyPy in a conda environment like this.

History

This library was initially developed at Stanford Exploration Project for solving large scale seismic problems. Inspired by Equinor's PyLops we publish this library as our contribution to scientific community.

How it works

This framework allows for the definition of linear and non-linear mapping functions that operate on abstract vector objects that can be defined to use heterogeneous computational resources, from personal laptops to HPC environments.

  • vector class: this is the building block for handling data. It contains the required mathematical operations such as norm, scaling, dot-product, sum, point-wise multiplication. These methods can be implemented using existing libraries (e.g., Numpy, Cupy, PyTorch) or user-defined ones (e.g., SEPLib). See the vector subpackage for details and implementations.

  • operator class: a mapping function between a domain vector and a range vector. It can be linear and non-linear. Linear operators require the definition of both the forward and adjoint functions; non-linear operators require the forward mapping and its Jacobian operator. See the operator subpackage for details and implementations.

  • problem class: it represents the objective function related to an optimization problem. Defined upon operators (e.g., modeling and regularization) and vectors (observed data, priors). It contains the methods for objective function and gradient computation, as our solvers are mainly gradient based. See the problem subpackage for details and implementations.

  • solver class: it aims at finding the solution to a problem by employing methods defined within the vector, operator and problem classes. Additionally, it allows to restart an optimization method from an intermetdiate result written as serialized objects on permanent computer memory. We have a number of linear and nonlinear solver, along with some stepper algorithms. See the solver subpackage for details and implementations.

Features at a glance

vector engines operators problems solvers
numpy linear least squares Conjugate Gradient
cupy nonlinear symmetric least squares Steepest Descent
torch distributed L2-reg least squares LSQR
LASSO symmetric Conjugate Gradient
generalized LASSO nonlinear Conjugate Gradient
nonlinear least squares L-BFGS
L2-reg nonlinear least squares L-BFGS-B
regularized Variable Projection Truncated Newton
Markov Chain Monte Carlo
ISTA and Fast-ISTA
ISTC (ISTA with cooling)
Split-Bregman

Scalability

The main objective of the described framework and implemented library is to solve large-scale inverse problems. Any vector and operator can be split into blocks to be distributed to multiple nodes. This is achieved via custom Dask vector and operator classes. See the dask subpackage for details and implementations.

Tutorials

We provide some tutorials that demonstrate the flexibility of occamypy. Please refer to them as a good starting point for developing your own code. If you have a good application example, contact us! We will be happy to see OccamyPy in action.

Check out the tutorial we gave at SWUNG's Transform 2022!

Contributing

Follow the following instructions and read carefully the CONTRIBUTING file before getting started.

Authors

Citation

@article{biondi2021object,
  title = {An object-oriented optimization framework for large-scale inverse problems},
  author = {Ettore Biondi and Guillaume Barnier and Robert G. Clapp and Francesco Picetti and Stuart Farris},
  journal = {Computers & Geosciences},
  volume = {154},
  pages = {104790},
  year = {2021},
  doi = {https://doi.org/10.1016/j.cageo.2021.104790},
}

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

occamypy-0.2.0.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

occamypy-0.2.0-py3-none-any.whl (125.7 kB view details)

Uploaded Python 3

File details

Details for the file occamypy-0.2.0.tar.gz.

File metadata

  • Download URL: occamypy-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.1

File hashes

Hashes for occamypy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ec00e69095273f253aa047dc36ae454d4424b15df0d1813a866d0611b1b0db19
MD5 547f61337b40ef5d599e0cf00d32f508
BLAKE2b-256 3fea48d89ecd8deea84b82508b3647285b76d66337d7ffa2de02f08c36ebc48e

See more details on using hashes here.

File details

Details for the file occamypy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: occamypy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 125.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.1

File hashes

Hashes for occamypy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc22adace4ffc31c254d1581c4f44bdfaecfeeadcda5c283adfec9e60567bee
MD5 994e65eec4a1af23bb7c9eb9f8a199bb
BLAKE2b-256 a94e05c9ba1f35e7bf2741fc7d9c7c4472a1a2e7fcae86c460c7ba1c33619f28

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page