Home

Awesome

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 with:

conda env create -n MYENV -f env.yml

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.

Features at a glance

vector enginesoperatorsproblemssolvers
numpylinearleast squaresConjugate Gradient
cupynonlinearsymmetric least squaresSteepest Descent
torchdistributedL2-reg least squaresLSQR
LASSOsymmetric Conjugate Gradient
generalized LASSOnonlinear Conjugate Gradient
nonlinear least squaresL-BFGS
L2-reg nonlinear least squaresL-BFGS-B
regularized Variable ProjectionTruncated 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.

We have a lot of ideas that might be helpful to scientists! We are currently working on:

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},
}

Publications using OccamyPy

If you have one to add, reach us out!