Geophysical Inversion and Modelling Library
v1.4.3
|
Public Types | |
typedef RVector | Vec |
typedef RVector | ModelVector |
![]() | |
typedef Vector< double > | ModelVector |
Public Member Functions | |
RInversion (bool verbose=false, bool dosave=false) | |
RInversion (ModellingBase &forward, bool verbose=false, bool dosave=false) | |
RInversion (const Vec &data, ModellingBase &forward, bool verbose=false, bool dosave=false) | |
RInversion (const Vec &data, ModellingBase &forward, Trans< Vec > &transData, bool verbose=true, bool dosave=false) | |
RInversion (const Vec &data, ModellingBase &forward, Trans< Vec > &transData, Trans< Vec > &transModel, bool verbose=true, bool dosave=false) | |
virtual | ~RInversion () |
void | setData (const Vec &data) |
const Vec & | data () const |
void | setRelativeError (const Vec &e) |
void | setRelativeError (double relerr) |
void | setAbsoluteError (const Vec &abserr) |
void | setAbsoluteError (double abserr) |
void | setError (const Vec &err, bool isRelative=true) |
void | setError (double err, bool isRelative=true) |
const Vec & | error () const |
void | checkError () |
Vec | errorDefault_ () |
void | setForwardOperator (ModellingBase &forward) |
ModellingBase * | forwardOperator () |
ModellingBase * | fop () |
void | setTransData (Trans< Vec > &tD) |
Trans< Vec > & | transData () |
void | setTransModel (Trans< Vec > &tM) |
Trans< Vec > & | transModel () |
uint | constraintsCount () const |
uint | dataCount () const |
void | setVerbose (bool verbose) |
bool | verbose () const |
void | setDoSave (bool d) |
bool | doSave () const |
void | saveModelHistory (bool doSaveModelHistory) |
void | setLineSearch (bool linesearch) |
bool | lineSearch () const |
void | setBlockyModel (bool isBlocky) |
bool | blockyModel () const |
void | setRobustData (bool isRobust) |
bool | robustData () const |
void | setLambda (double lambda) |
double | lambda () const |
double | getLambda () const |
void | setLambdaFactor (double lambdaFactor) |
double | lambdaFactor () const |
void | setLambdaMinimum (double l) |
double | lambdaMinimum () const |
void | setLocalRegularization (bool localReg) |
bool | localRegularization () const |
void | setOptimizeLambda (bool opt) |
bool | optimizeLambda () const |
void | setMaxIter (int maxiter) |
int | maxIter () const |
void | setMaxCGLSIter (int iter) |
int | maxCGLSIter () const |
void | setCGLSTolerance (double tol) |
double | maxCGLSTolerance () const |
uint | iter () const |
bool | isRunning () const |
void | abort () |
void | stopAtChi1 (bool stopAtChi1) |
void | setDeltaPhiAbortPercent (double dPhi) |
double | deltaPhiAbortPercent () const |
void | setMarquardtScheme (double lambdaFactor=0.8) |
void | checkTransFunctions () |
void | setRecalcJacobian (bool recalc) |
bool | recalcJacobian () const |
void | setBroydenUpdate (bool broydenUpdate) |
bool | broydenUpdate () const |
void | setModel (const Vec &model) |
const ModelVector & | model () const |
void | setReferenceModel (const Vec &model) |
void | setResponse (const Vec &response) |
void | setConstraintsH (const Vec &constraintsH) |
const Vec & | response () const |
Vec | getIRLS () const |
void | setCWeight (const Vec &cWeight) |
const Vec & | cWeight () const |
void | setMWeight (const Vec &mweight) |
const Vec & | mWeight () const |
void | robustWeighting () |
void | constrainBlocky () |
void | checkConstraints () |
void | checkJacobian (bool force=false) |
void | echoStatus () const |
void | echoStatus (const Vec &response, const Vec &model, const std::string &xtra="") const |
Vec | modelCellResolution (int iModel) |
Vec | modelCellResolution (const RVector3 &pos) |
RMatrix | modelResolutionMatrix () |
RVector | roughness (const RVector &model) const |
RVector | roughness () const |
RVector | pureRoughness (const RVector &model) const |
double | getPhiD (const Vec &response) const |
double | getPhiM (const Vec &model) const |
double | getPhi (const Vec &model, const Vec &response) const |
double | getPhiD () const |
double | getPhiM () const |
double | getPhi () const |
double | getChi2 () const |
double | getChi2 (const Vec &response) const |
double | chi2 () const |
double | absrms () const |
double | relrms () const |
double | linesearch (const Vec &modelNew, const Vec &responseNew) const |
double | linesearchQuad (const Vec &modelNew, const Vec &responseNew, const Vec &modelQuad, const Vec &responseQuad, double tauquad) const |
const std::vector< RVector > & | modelHistory () const |
Vec | invSubStep (const Vec &rhs) |
Vec | optLambda (const Vec &deltaData, const Vec &deltaModel0) |
bool | oneStep () |
!! h-variante More... | |
const Vec & | invert (const Vec &data) |
const Vec & | start () |
const Vec & | run () |
Vec | runChi1 (double acc=0.01, int maxiter=50) |
const RVector & | modelWeight () const |
const RVector & | modelRef () const |
const RVector & | dataWeight () const |
const RVector & | deltaDataIter () const |
const RVector & | deltaModelIter () const |
void | reset () |
![]() | |
InversionBase () | |
virtual | ~InversionBase () |
virtual const ModelVector & | model () const=0 |
virtual const ModelVector & | cWeight () const=0 |
virtual uint | iter () const=0 |
virtual double | chi2 () const=0 |
virtual bool | isRunning () const=0 |
Protected Member Functions | |
void | init_ () |
Protected Attributes | |
Vec | data_ |
ModellingBase * | forward_ |
Trans< Vec > * | tD_ |
Trans< Vec > * | tM_ |
Trans< Vec > * | transModelDefault_ |
Trans< Vec > * | transDataDefault_ |
bool | verbose_ |
bool | dosave_ |
bool | saveModelHistory_ |
Vec | error_ |
Vec | response_ |
Vec | model_ |
Vec | modelRef_ |
Vec | constraintsH_ |
Vec | constraintWeights_ |
Vec | modelWeight_ |
Vec | dataWeight_ |
Vec | deltaDataIter_ |
Vec | deltaModelIter_ |
int | maxiter_ |
int | iter_ |
int | maxCGLSIter_ |
double | lambda_ |
double | lambdaFactor_ |
double | lambdaMin_ |
double | dPhiAbortPercent_ |
double | CGLStol_ |
bool | isBlocky_ |
bool | isRobust_ |
bool | isRunning_ |
bool | useLinesearch_ |
bool | optimizeLambda_ |
bool | abort_ |
bool | stopAtChi1_ |
bool | doBroydenUpdate_ |
bool | localRegularization_ |
bool | haveReferenceModel_ |
bool | recalcJacobian_ |
bool | jacobiNeedRecalc_ |
bool | activateFillConstraintWeights_ |
bool | fixError_ |
std::vector< RVector > | modelHist_ |
Inversion template using a Generalized Minimization Approach, atm fixed to Gauss-Newton solver Inversion(bool verbose, bool dosave Inversion(RVector data, FOP f, bool verbose, bool dosave Inversion(RVector data, FOP f, transData, transModel, bool verbose, bool dosave
|
inline |
Minimal constructor. verbose – gives some output and status information about the inversion progress; dosave – advanced debuging, saves alot of stuff and temporary data
|
inline |
Contructor for forward operator only
|
inline |
Usual constructor. data – vector of the given data; forward – the associated forward operator
|
inline |
Intermediate constructor including transforms and data transformation function
|
inline |
Full constructor including transforms. transData – data transformation function; transModel – model transformation function
|
inlinevirtual |
Destructor. Frees allocated memory
|
inlinevirtual |
Force abort at next iteration
Implements GIMLI::InversionBase< double >.
|
inline |
Return last absolute RMS misfit
void GIMLI::RInversion::checkConstraints | ( | ) |
Create constraints, check and compare size of constraint matrix with model/boundary control
References GIMLI::Vector< ValueType >::resize().
|
inline |
Validate the data error. This check will be called at every new run or change of the error; Check size and content unequal to zero. If problems found, warn and set the data error to errorDefault_()
void GIMLI::RInversion::checkJacobian | ( | bool | force = false | ) |
Check size of Jacobian matrix against data and model number
|
inline |
Check if transfunctions are valid, set default if no transfunctions are given or override given functions by regionManager.transfunctions if available
|
inline |
Return last chi-squared data misfit
|
inline |
Apply blocky model constraints (see also setBlockyModel)
|
inline |
Return number of constraints
|
inline |
Return reference to the current constraints weight vector
|
inline |
Get data vector
|
inline |
Return number of data
|
inline |
Shortcut for echoStatus(response_, model_).
|
inline |
Echo PhiD/PhiM/Phi and Chi^2 for given model and response
|
inline |
Return the used data error
|
inline |
Return a copy of the default data error array, [ Relative data error of 1% ]
|
inline |
Return forward operator. Shortcut for forwardOperator()
|
inlinevirtual |
Return forward operator.
Implements GIMLI::InversionBase< double >.
|
inline |
Return the chi-squared data misfit DEPRECATED wrong nameing scheme
|
inline |
Return the chi-squared data misfit for given forward response. DEPRECATED wrong nameing scheme
|
inline |
Return IRLS function of roughness vector
|
inline |
Shortcut for getPhi(model_, response_) necessary ? DEPRECATED wrong nameing scheme
Return total objective function (data OF plus lambda times model OF) DEPRECATED wrong nameing scheme
|
inline |
Shortcut for getPhiD(response_) necessary ? DEPRECATED wrong nameing scheme
double GIMLI::RInversion::getPhiD | ( | const Vec & | response | ) | const |
Return data objective function (sum of squared data-weighted misfit)
|
inline |
Shortcut for getPhiM(model_) necessary ? DEPRECATED wrong nameing scheme
double GIMLI::RInversion::getPhiM | ( | const Vec & | model | ) | const |
Return model objective function (squared model roughness)
|
inlineprotected |
Internal initialization function, which is called from constructor. Set default paramater and allocate required memory
Start the inversion with specific data.
Compute model update by solving one inverse sub-step
rhs | The right-hand-side vector of the system of equation |
!! h-variante
|
inline |
Return true if inversion is running
|
inline |
Return curent iteration number
|
inline |
Return the minimum lambda value that can be reached if lambda factor is set.
Start with linear interpolation, followed by quadratic fit if linesearch parameter tau is lower than 0.03. Tries to return values between 0.03 and 1
rigorous minimization of the total objective function
parabolic line search using step 0, 1 and tauquad to fit parabola
too large
negative or nearly zero (stucked) -> use small step instead
only if not nearly one (which saves a forward run
|
inline |
Compute objective function for old (tau=0), new (tau=1) and another model
|
inline |
Return whether regularization is global or local (e.g. Marquardt method)
|
inline |
Return a const reference to the current model vector
Compute cell resolution for closest cell to given position
References GIMLI::Matrix< ValueType >::push_back().
|
inline |
Compute model cell resolution (specific column of resolution matrix) by an LSCG solver (Guenther, 2004)
|
inline |
Return the single models for each iteration. For debugging.
|
inline |
Compute whole resolution matrix by single cell resolutions
|
inline |
Return reference to the current model weight vector
References GIMLI::getIRLSWeights().
bool GIMLI::RInversion::oneStep | ( | ) |
!! h-variante
One iteration step. Return true if the step can be calculated successfully else false is returned.
full step possible;
normal line search parameter between 0.03 and 0.94
** temporary stuff
References roughness().
Optimization of regularization parameter by L-curve
Return (C * m) , i.e. the pure (unweighted) roughness
|
inline |
Return last relative RMS misfit
|
inline |
Resets this inversion to the given startmodel.
|
inline |
Return a reference to the current response vector
|
inline |
Call robust date reweighting (see also setRobustData)
|
inline |
Shortcut for roughness for the current model vector
Referenced by oneStep().
Return (C * m * m_w) * c_w
|
virtual |
Start the inversion procedure from the last model and return the final model vector.
Run inversion with current model.
calculation of initial modelresponse
() clear the model history
validate and rebuild the data error if necessary
validate and rebuild the constraint matrix if necessary
compute roughness constraint and correct it for inter-region constraints
validate and rebuild the jacobian if necessary
Implements GIMLI::InversionBase< double >.
|
inline |
Specialized run function that tries to reach a datafit chi^2=1 by varying the regularization paramater lambda
|
inline |
Set and get verbose behaviour
|
inline |
Set the absolute data error to the vector abserr
|
inline |
Set absolute data error to the scalar value abserr
|
inline |
Set and get blocky model behaviour (by L1 reweighting of constraints)
|
inline |
Enable/disable broyden update (which enforces scaling by transform function derivatives
|
inline |
Set and get abort tolerance for cgls solver. -1 means default scaling [default]
|
inline |
Set constraint right-hand side by hand (very special cases, so be careful)
|
inline |
Set the constraint weight (boundary control) vector
|
inlinevirtual |
Set data vector
Implements GIMLI::InversionBase< double >.
|
inline |
Set and get relative objective function decrease
|
inline |
Set debug output
|
inlinevirtual |
Set the forward operator and the model-transform-function derived from fop-regionManager if not set before.
why is this so strictly necessary???
Always use a region manager
Implements GIMLI::InversionBase< double >.
|
inlinevirtual |
Set and get regularization parameter and its change over iteration
Implements GIMLI::InversionBase< double >.
|
inline |
Set the minimum lambda value that can be reached if lambda factor is set. Default is 1.
|
inline |
Set and get line search
|
inline |
Set whether regularization is global or local (e.g. Marquardt method)
|
inline |
Marquardt scheme (local damping with decreasing regularization strength
no contribution of regularization to objective function
lambda is decreased towards zero
let the solution fully converge (important for statistics)
|
inline |
Set and get maximum iteration number for inverse sub step
|
inlinevirtual |
Set and get maximum iteration number
Implements GIMLI::InversionBase< double >.
|
inlinevirtual |
Set model vector . If you call run() the inversion starts with this model, otherwise it will start with fop.startModel().
Implements GIMLI::InversionBase< double >.
|
inline |
Set the model weight vector
|
inline |
Set and get whether lambda is being optimized by Lcurve
|
inline |
Define and find out whether Jacobian is recalculated in each iteration
|
inlinevirtual |
Set reference model vector
Implements GIMLI::InversionBase< double >.
References GIMLI::getIRLSWeights().
|
inline |
Set the relative data error to the vector err.
|
inline |
Set relative data error to scalar error value relerr. If you force relerr == 0 here. Data will not corrected or weighted.
|
inline |
Set current model response (e.g. to avoid time-consuming forward calculation, but be careful)
|
inline |
Set and get robust data weighting by L1 reweighting scheme
Set and get data transform. WARNING! we just store a reference to the trans .. U have to ensure that the trans is and stayes valid. TODO change this!!!
Implements GIMLI::InversionBase< double >.
Set and get Model transform WARNING! we just store a reference to the trans .. U have to ensure that the trans is and stayes valid. TODO change this!!!
Implements GIMLI::InversionBase< double >.
|
inline |
Set verbose output
const RVector & GIMLI::RInversion::start | ( | ) |
Start the inversion procedure from starting model.
Start inversion from starting model.
|
inline |
Define whether minimization stops at chi^2=1
|
protected |
Set this to zero if u want to use absolute errors == zero
|
protected |
Hold old models, for debuging