InvProblem

class SimPEG.inverse_problem.BaseInvProblem(dmisfit, reg, opt)[source]

Bases: SimPEG.props.BaseSimPEG

Optional Properties:

  • model (Model): Inversion model., a numpy array of <class ‘float’>, <class ‘int’> with shape (*, *) or (*)

beta = 1.0

Trade-off parameter

debug = False

Print debugging information

counter = None

Set this to a SimPEG.utils.Counter() if you want to count things

deleteTheseOnModelUpdate = []

List of strings, e.g. [‘_MeSigma’, ‘_MeSigmaI’]

property model

model (Model): Inversion model., a numpy array of <class ‘float’>, <class ‘int’> with shape (*, *) or (*)

dmisfit = None

DataMisfit

reg = None

Regularization

opt = None

Optimization program

startup(m0)[source]

Called when inversion is first starting.

If you have things that also need to run in the method startup, you can create a method:

def _startup*(self, ... ):
    pass

Where the * can be any string. If present, _startup* will be called at the start of the default startup call. You may also completely overwrite this function.

property warmstart
getFields(m, store=False, deleteWarmstart=True)[source]
get_dpred(m, f)[source]
evalFunction(m, return_g=True, return_H=True)[source]

Inversion

class SimPEG.inversion.BaseInversion(invProb, directiveList=None, **kwargs)[source]

Bases: object

Inversion Class

name = 'BaseInversion'
debug = False

Print debugging information

counter = None

Set this to a SimPEG.utils.Counter() if you want to count things

property directiveList
run(m0)[source]

Runs the inversion!

Directives

class SimPEG.directives.InversionDirective(*args, **kwargs)[source]

Bases: properties.base.base.HasProperties

debug = False

Print debugging information

property inversion

This is the inversion of the InversionDirective instance.

property invProb
property opt
property reg
property dmisfit
property survey

Assuming that dmisfit is always a ComboObjectiveFunction, return a list of surveys for each dmisfit [survey1, survey2, … ]

property simulation

Assuming that dmisfit is always a ComboObjectiveFunction, return a list of problems for each dmisfit [prob1, prob2, …]

property prob

simulation.prob has been deprecated. See simulation for documentation

initialize()[source]
endIter()[source]
finish()[source]
validate(directiveList=None)[source]

Call all registered class validator methods

These are all methods decorated with @properties.validator. Validator methods are expected to raise a ValidationError if they fail.

class SimPEG.directives.DirectiveList(*directives, **kwargs)[source]

Bases: object

dList = None

The list of Directives

property debug
property inversion

This is the inversion of the InversionDirective instance.

call(ruleType)[source]
validate()[source]
class SimPEG.directives.BetaEstimate_ByEig(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

BetaEstimate

beta0 = None

The initial Beta (regularization parameter)

beta0_ratio = 100.0

estimateBeta0 is used with this ratio

initialize()[source]

The initial beta is calculated by comparing the estimated eigenvalues of JtJ and WtW. To estimate the eigenvector of A, we will use one iteration of the Power Method:

\[\mathbf{x_1 = A x_0}\]

Given this (very course) approximation of the eigenvector, we can use the Rayleigh quotient to approximate the largest eigenvalue.

\[\lambda_0 = \frac{\mathbf{x^\top A x}}{\mathbf{x^\top x}}\]

We will approximate the largest eigenvalue for both JtJ and WtW, and use some ratio of the quotient to estimate beta0.

\[\beta_0 = \gamma \frac{\mathbf{x^\top J^\top J x}}{\mathbf{x^\top W^\top W x}}\]
Return type

float

Returns

beta0

class SimPEG.directives.BetaSchedule(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

coolingFactor = 8.0
coolingRate = 3
endIter()[source]
class SimPEG.directives.TargetMisfit(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

… note:: Currently the target misfit is not set up for joint inversions. Get in touch if you would like to help with the upgrade!

chifact = 1.0
phi_d_star = None
property target
endIter()[source]
print_final_misfit()[source]
class SimPEG.directives.SaveEveryIteration(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

This directive saves an array at each iteration. The default directory is the current directoy and the models are saved as InversionModel-YYYY-MM-DD-HH-MM-iter.npy

Required Properties:

  • directory (String): directory to save results in, a unicode string, Default: .

  • name (String): root of the filename to be saved, a unicode string, Default: InversionModel

property directory

directory (String): directory to save results in, a unicode string, Default: .

property name

name (String): root of the filename to be saved, a unicode string, Default: InversionModel

property fileName
class SimPEG.directives.SaveModelEveryIteration(*args, **kwargs)[source]

Bases: SimPEG.directives.SaveEveryIteration

This directive saves the model as a numpy array at each iteration. The default directory is the current directoy and the models are saved as InversionModel-YYYY-MM-DD-HH-MM-iter.npy

Required Properties:

  • directory (String): directory to save results in, a unicode string, Default: .

  • name (String): root of the filename to be saved, a unicode string, Default: InversionModel

initialize()[source]
endIter()[source]
class SimPEG.directives.SaveOutputEveryIteration(*args, **kwargs)[source]

Bases: SimPEG.directives.SaveEveryIteration

Required Properties:

  • directory (String): directory to save results in, a unicode string, Default: .

  • name (String): root of the filename to be saved, a unicode string, Default: InversionModel

header = None
save_txt = True
beta = None
phi_d = None
phi_m = None
phi_m_small = None
phi_m_smooth_x = None
phi_m_smooth_y = None
phi_m_smooth_z = None
phi = None
initialize()[source]
endIter()[source]
load_results()[source]
plot_misfit_curves(fname=None, dpi=300, plot_small_smooth=False, plot_phi_m=True, plot_small=False, plot_smooth=False)[source]
plot_tikhonov_curves(fname=None, dpi=200)[source]
class SimPEG.directives.SaveOutputDictEveryIteration(*args, **kwargs)[source]

Bases: SimPEG.directives.SaveEveryIteration

Saves inversion parameters at every iteration.

Required Properties:

  • directory (String): directory to save results in, a unicode string, Default: .

  • name (String): root of the filename to be saved, a unicode string, Default: InversionModel

outDict = None
saveOnDisk = False
initialize()[source]
endIter()[source]
class SimPEG.directives.Update_IRLS(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

Required Properties:

  • beta_search (Boolean): Do a beta serarch, a boolean, Default: False

  • coolingFactor (Float): Cooling factor, a float, Default: 2.0

  • coolingRate (Integer): Cooling rate, an integer, Default: 1

  • max_irls_iterations (Integer): maximum irls iterations, an integer, Default: 20

  • update_beta (Boolean): Update beta, a boolean, Default: True

f_old = 0
f_min_change = 0.01
beta_tol = 0.1
beta_ratio_l2 = None
prctile = 100
chifact_start = 1.0
chifact_target = 1.0
irls_iteration = 0
minGNiter = 1
property max_irls_iterations

max_irls_iterations (Integer): maximum irls iterations, an integer, Default: 20

iterStart = 0
sphericalDomain = False
property update_beta

update_beta (Boolean): Update beta, a boolean, Default: True

beta_search (Boolean): Do a beta serarch, a boolean, Default: False

property coolingFactor

coolingFactor (Float): Cooling factor, a float, Default: 2.0

property coolingRate

coolingRate (Integer): Cooling rate, an integer, Default: 1

ComboObjFun = False
mode = 1
coolEpsOptimized = True
coolEps_p = True
coolEps_q = True
floorEps_p = 1e-08
floorEps_q = 1e-08
coolEpsFact = 1.2
silent = False
fix_Jmatrix = False
property maxIRLSiters

maxIRLSiters has been deprecated. See max_irls_iterations for documentation

property updateBeta

updateBeta has been deprecated. See update_beta for documentation

property betaSearch

betaSearch has been deprecated. See beta_search for documentation

property target
property start
initialize()[source]
endIter()[source]
startIRLS()[source]
angleScale()[source]

Update the scales used by regularization for the different block of models

validate(directiveList)[source]

Call all registered class validator methods

These are all methods decorated with @properties.validator. Validator methods are expected to raise a ValidationError if they fail.

class SimPEG.directives.UpdatePreconditioner(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

Create a Jacobi preconditioner for the linear problem

update_every_iteration = True

Update every iterations if False

initialize()[source]
endIter()[source]
class SimPEG.directives.Update_Wj(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

Create approx-sensitivity base weighting using the probing method

k = None
itr = None
endIter()[source]
class SimPEG.directives.UpdateSensitivityWeights(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

Directive to take care of re-weighting the non-linear magnetic problems.

mapping = None
JtJdiag = None
everyIter = True
threshold = 1e-12
switch = True
initialize()[source]
endIter()[source]
update()[source]
getJtJdiag()[source]

Compute explicitly the main diagonal of JtJ Good for any problem where J is formed explicitly

getWr()[source]

Take the diagonal of JtJ and return a normalized sensitivty weighting vector

updateReg()[source]

Update the cell weights with the approximated sensitivity

validate(directiveList)[source]

Call all registered class validator methods

These are all methods decorated with @properties.validator. Validator methods are expected to raise a ValidationError if they fail.

class SimPEG.directives.ProjectSphericalBounds(*args, **kwargs)[source]

Bases: SimPEG.directives.InversionDirective

Trick for spherical coordinate system. Project heta and phi angles back to [-pi,pi] using back and forth conversion. spherical->cartesian->spherical

initialize()[source]
endIter()[source]