simpeg.directives.SaveModelEveryIteration#

class simpeg.directives.SaveModelEveryIteration(**kwargs)[source]#

Bases: SaveEveryIteration

Saves the inversion model at the end of every iteration to a directory

Parameters:
directorypathlib.Path or str, optional

The directory to store output information to, defaults to current directory.

namestr, optional

Root of the filename to be saved, defaults to 'InversionModel'

Attributes

directory

Directory to save results in.

dmisfit

Data misfit associated with the directive.

file_abs_path

The absolute path to the saved output file.

invProb

Inverse problem associated with the directive.

inversion

Inversion object associated with the directive.

name

Root of the filename to be saved.

on_disk

This class always saves to disk.

opt

Optimization algorithm associated with the directive.

reg

Regularization associated with the directive.

simulation

Return simulation for all data misfits.

survey

Return survey for all data misfits

verbose

Whether or not to print debugging information.

fileName

Methods

endIter()

Update inversion parameter(s) according to directive at end of iteration.

finish()

Update inversion parameter(s) according to directive at end of inversion.

initialize()

Initialize inversion parameter(s) according to directive.

validate([directiveList])

Validate directive.

Notes

This directive saves the model as a numpy array at each iteration. The default directory is the current directory and the models are saved as name + '_YYYY-MM-DD-HH-MM_iter.npy'