pyrtid.inverse.regularization#

PyRTID invsere sub module providing regularization tools.

The following functionalities are directly provided on module-level.

Abstract classes#

Base class from which to derive regularizator implementations.

Regularizator(preconditioner)

Represent a regularizator.

Local#

Tikhonov (for smooth spatial distribution)#

TikhonovRegularizator(grid, preconditioner)

Apply an Tikhonov (smoothing) regularization.

TikhonovMatRegularizator(grid, ...)

Apply an Tikhonov (smoothing) regularization using matrix formulation.

TikhonovFVMRegularizator(grid, ...)

Apply an Tikhonov (smoothing) regularization using the Finite Volume Method.

Total Variation (for blocky spatial distribution)#

TVRegularizator(grid, eps, preconditioner)

Apply a Total Variation (sharpening) regularization.

TVMatRegularizator(grid, sub_selection, ...)

Apply a Total Variation (sharpening) regularization with matrix formulation.

TVFVMRegularizator(grid, sub_selection, ...)

Apply an Tikhonov (smoothing) regularization using the Finite Volume Method.

Discrete to impose specific discrete values to the field#

DiscreteRegularizator(modes, penalty, ] =, ...)

Apply a discrete (values takes specific discrete values) regularization.

Global#

Fitting empirical distributions#

ProbDistFitting(target_values, ...)

Apply an (empirical) probability distribution fitting regularization.

Geostatistic regularizator#

Provide classes to implement regularization based on a parameter covariance matrix. The first one work with a single vector while the second class works with an ensemble of realizations.

GeostatisticalRegularizator(cov_m, prior, ...)

Implement a regularization based on the parameter covariance matrix.

EnsembleRegularizator(cov_m, prior, ...)

Implement a regularization based on an ensemble.

Covariance classes#

To represent covariance matrices.

CovarianceMatrix(*args, **kwargs)

Represents a covariance matrix.

DenseCovarianceMatrix(*args, **kwargs)

Represents a dense covariance matrix.

EnsembleCovarianceMatrix(*args, **kwargs)

Represents a covariance matrix as an ensemble of realizations.

FFTCovarianceMatrix(*args, **kwargs)

Represents a fast fourier transform covariance matrix.

EigenFactorizedCovarianceMatrix(*args, **kwargs)

Compressed version of the covariance matrix.

SparseInvCovarianceMatrix(*args, **kwargs)

Represents a sparse inverse covariance matrix.

HCovarianceMatrix(*args, **kwargs)

Represents a hierarchical covariance matrix.

SparseInvCovarianceMatrix(*args, **kwargs)

Represents a sparse inverse covariance matrix.

Covariance functions#

To work with covariance matrices and low rank approximations.

eigen_factorize_cov_mat(cov_mat, n_pc[, ...])

Return an eigen factorized covariance matrix from the input covariance matrix.

generate_dense_matrix(pts, kernel, len_scale)

Generate a dense matrix.

get_matrix_eigen_factorization(cov_mat, n_pc)

Compute Eigenmodes of the covariance.

sample_from_sparse_cov_factor(mean, factor)

Sample from the given sparse factor of the covariance matrix and the given mean.

get_explained_var(eigval[, cov_mat, ...])

Return the variance explained by each eigen value.

Matrix compression#

Eigen decomposition

get_matrix_eigen_factorization(cov_mat, n_pc)

Compute Eigenmodes of the covariance.

eigen_factorize_cov_mat(cov_mat, n_pc[, ...])

Return an eigen factorized covariance matrix from the input covariance matrix.

Regularization weights selection#

Strategies for the weight evaluation#

Class to indicate what strategy to use to weight the objective function regularization term.

RegWeightUpdateStrategy([reg_weight])

Strategy to update the regularization parameter while optimizing.

AdaptiveUCRegweight([reg_weight_init, ...])

Implement an adaptive regularization parameter choice based on the U-Curve.

AdaptiveRegweight([reg_weight_init, ...])

Abstract interface for adaptive regularization parameter choice.

AdaptiveGradientNormRegweight([norm, ...])

Implement an adaptive regularization parameter choice based on the U-Curve.

ConstantRegWeight([reg_weight])

Implement a constant regularization parameter.

Curvature in the context of L-curve plot#

Evaluate curvature of a L-curve

get_l_curvature(reg_weights, loss_ls_list, ...)

Interpolate and evaluate the L-curve curvature.