hippylib / hippylibx

The next version of hIPPYlib powered by dolfinx
GNU General Public License v2.0
0 stars 1 forks source link

CI Documentation Status

hippylibx

         __        ______  _______   _______   __      __  __  __  __     ______       _____  
        /  |      /      |/       \ /       \ /  \    /  |/  |/  |/  |    \    \      /    /     
        $$ |____  $$$$$$/ $$$$$$$  |$$$$$$$  |$$  \  /$$/ $$ |$$/ $$ |____ \ $$ \    / $$ /   
        $$      \   $$ |  $$ |__$$ |$$ |__$$ | $$  \/$$/  $$ |/  |$$      \ \ $$ \  / $$ /    
        $$$$$$$  |  $$ |  $$    $$/ $$    $$/   $$  $$/   $$ |$$ |$$$$$$$  | | $$$$$$$$ /     
        $$ |  $$ |  $$ |  $$$$$$$/  $$$$$$$/     $$$$/    $$ |$$ |$$ |  $$ | | $$$$$$$$ |     
        $$ |  $$ | _$$ |_ $$ |      $$ |          $$ |    $$ |$$ |$$ |__$$ |/ $$ /  \ $$ \    
        $$ |  $$ |/ $$   |$$ |      $$ |          $$ |    $$ |$$ |$$    $$/  $$ /    \ $$ \   
        $$/   $$/ $$$$$$/ $$/       $$/           $$/     $$/ $$/ $$$$$$$/_ $$_/      \_$$_\  
                                        https://hippylib.github.io

hIPPYlibx is the next version of hIPPYlib powered by DOLFINx and incorporates state-of-the-art scalable algorithms for deterministic and Bayesian inverse problems governed by partial differential equations (PDEs). It builds on FEniCSx (a parallel finite element element library) for the discretization of the PDE and on PETSc for scalable and efficient linear algebra operations and solvers. It is written in pure Python and is compatible with version 0.8.0 of DOLFINx, the computational environment of FEniCSx.

For building instructions, see the file INSTALL.md. Copyright information and licensing restrictions can be found in the file COPYRIGHT.

The best starting point for new users interested in hIPPYlibx's features are the examples in the example folder.

Conceptually, hIPPYlibx serves as a toolbox that provides the building blocks for experimenting new ideas and developing scalable algorithms for PDE-constrained deterministic and Bayesian inverse problems.

In hIPPYlibx the user can express the forward PDE and the likelihood in weak form using the friendly, compact, near-mathematical notation of FEniCSx, which will then automatically generate efficient code for the discretization. Linear, nonlinear and stationary PDEs are supported in hIPPYlibx. For stationary problems, gradient and Hessian information can be automatically generated by hIPPYlibx using FEniCSx symbolic differentiation of the relevant weak forms.

Noise and prior covariance operators are modeled as inverses of elliptic differential operators. This approach enables building on existing fast multigrid solvers for elliptic operators without explicitly constructing the dense covariance operator.

The key property of the algorithms underlying hIPPYlibx is that solution of the deterministic and Bayesian inverse problem is computed at a cost, measured in forward PDE solves, that is independent of the parameter dimension.

hIPPYlibx provides a robust implementation of the inexact Newton-conjugate gradient algorithm to compute the maximum a posterior (MAP) point. The gradient and Hessian actions are computed via their weak form specification in FEniCSx by constraining the state and adjoint variables to satisfy the forward and adjoint problem. The Newton system is solved inexactly by early termination of CG iterations via Eisenstat-Walker (to prevent oversolving) and Steihaug (to avoid negative curvature) criteria. Globalization is achieved using the Armijo back-tracking line search technique.

In hIPPYlibx, the posterior covariance is approximated by the inverse of the Hessian of the negative log posterior evaluated at the MAP point. This Gaussian approximation is exact when the parameter-to-observable map is linear; otherwise, its logarithm agrees to two derivatives with the log posterior at the MAP point, and thus it can serve as a proposal for Hessian-based Markov chain Monte Carlo (MCMC) methods. hIPPYlibx makes the construction of the posterior covariance tractable by invoking a low-rank approximation of the Hessian of the log likelihood.

hIPPYlibx also offers scalable methods for sample generation. To sample large scale spatially correlated Gaussian random fields from the prior distribution, hIPPYlibx implements a method that strongly relies on the structure of the covariance operator defined as the inverse of a differential operator: by exploiting the assembly procedure of finite element matrices hIPPYlibx constructs a sparse Cholesky-like rectangular decomposition of the precision operator. To sample from a local Gaussian approximation to the posterior (such as at the MAP point) hIPPYlibx exploits the low rank factorization of the Hessian of the log likelihood to correct samples from the prior distribution.