Version:
This tutorial is presented as Python code running inside a Jupyter Notebook, the recommended way to use Salvus. To run it yourself you can copy/type each individual cell or directly download the full notebook, including all required files.
Copy
%matplotlib inline
%config Completer.use_jedi = False

import os

SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")

Inverting for homogeneous material

In this mini-tutorial, we demonstrate how the mapping function can be used to invert for homogeneous material parameters. Here, the adjoint operation of the mapping class maps the space-dependent physical gradient into the subspace of homogeneous model parameters.

Take-home message

Selecting scaling="homogeneous" in the mapping function of an InverseProblemConfiguration enables inversion for homogeneous model parameters with full-waveform inversion.
sn.Mapping(
    scaling="homogeneous",
    inversion_parameters=[...],
    ...
)
import matplotlib.pyplot as plt
import numpy as np
import pathlib
import time
import xarray as xr

import salvus.namespace as sn
We consider a simplistic setup with a 2D elastic box domain with a single source-receiver pair.
Check out the full FWI tutorial for more details on the individual steps.
p = sn.Project.from_domain(
    path="project",
    domain=sn.domain.dim2.BoxDomain(
        x0=0.0,
        x1=1.0,
        y0=0.0,
        y1=1.5,
    ),
    load_if_exists=True,
)
src = sn.simple_config.source.cartesian.VectorPoint2D(
    x=0.33, y=0.0, fx=0.0, fy=1.0e9
)

rec = sn.simple_config.receiver.cartesian.Point2D(
    x=0.67,
    y=1.5,
    fields=["displacement"],
    network_code="REC",
    station_code="000",
)

p += sn.Event(event_name="event", sources=src, receivers=rec)
ec = sn.EventConfiguration(
    waveform_simulation_configuration=sn.WaveformSimulationConfiguration(
        end_time_in_seconds=0.0006
    ),
    wavelet=sn.simple_config.stf.Ricker(center_frequency=10000.0),
)
p.viz.nb.domain()
We consider two different homogeneous isotropic media. The "true" model we seek to reconstruct varies from the initial model in vp, vs and rho. Note that the deviations in the parameters have opposite signs and different magnitudes.
true_model = sn.model.background.homogeneous.IsotropicElastic(
    vp=5800.0, vs=3200.0, rho=2600.0
)
initial_model = sn.model.background.homogeneous.IsotropicElastic(
    vp=5600.0, vs=3300.0, rho=2400.0
)
for name, model in zip(["true", "init"], [true_model, initial_model]):
    p.add_to_project(
        sn.SimulationConfiguration(
            name=name,
            elements_per_wavelength=2,
            tensor_order=1,
            max_frequency_in_hertz=20000.0,
            model_configuration=sn.ModelConfiguration(background_model=model),
            event_configuration=ec,
        ),
        overwrite=True,
    )

    p.simulations.launch(
        simulation_configuration=name,
        events=p.events.get_all(),
        site_name=SALVUS_FLOW_SITE_NAME,
        ranks_per_job=1,
    )
[2023-11-29 20:10:13,606] INFO: Creating mesh. Hang on.
[2023-11-29 20:10:13,968] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010073987_c610a9df82@local
[2023-11-29 20:10:14,142] INFO: Creating mesh. Hang on.
[2023-11-29 20:10:14,175] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010179411_0e48a04766@local
p.simulations.query(block=True)
True
This is of course not a realistic setup, but the waveforms differ in both components.
p.viz.nb.waveforms(data=["true", "init"], receiver_field="displacement")
Next, we setup the inverse problem. We are using scaling="homogeneous" in the mapping function, which enforces a homogeneous medium in every iteration. Note that a smoothing preconditioner is not necessary here, because the mapped gradient is already homogeneous.
p += sn.MisfitConfiguration(
    name="L2",
    observed_data="true",
    misfit_function="L2",
    receiver_field="displacement",
)
p += sn.InverseProblemConfiguration(
    name="inversion",
    prior_model="init",
    events=p.events.list(),
    mapping=sn.Mapping(
        scaling="homogeneous",
        inversion_parameters=["VP", "VS", "RHO"],
    ),
    method=sn.TrustRegion(initial_trust_region_linf=100.0),
    misfit_configuration="L2",
    job_submission=sn.SiteConfig(
        site_name=SALVUS_FLOW_SITE_NAME, ranks_per_job=1
    ),
)
for i in range(10):
    p.inversions.iterate(
        inverse_problem_configuration="inversion",
        timeout_in_seconds=360,
        ping_interval_in_seconds=1,
    )
[2023-11-29 20:10:15,440] INFO: Adding new iteration #0.
[2023-11-29 20:10:15,447] INFO: Resuming iteration #0.

[2023-11-29 20:10:15,447] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:15,448] INFO: Processing task `misfit_and_gradient`
[2023-11-29 20:10:15,464] INFO: The following events have been simulated before, but checkpoints are not available for this combination of `site_name` and `ranks_per_job` and wavefield compression settings. They will be run again: ['event']
[2023-11-29 20:10:15,475] INFO: Submitting job ...
[2023-11-29 20:10:15,516] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:15,516] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2023-11-29 20:10:16,518] INFO: Processing task `misfit_and_gradient`
[2023-11-29 20:10:16,565] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2023-11-29 20:10:17,568] INFO: Processing task `misfit_and_gradient`
[2023-11-29 20:10:17,613] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2023-11-29 20:10:18,615] INFO: Processing task `misfit_and_gradient`
[2023-11-29 20:10:18,853] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010855542_868fa40955@local
[2023-11-29 20:10:18,895] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:18,895] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2023-11-29 20:10:19,896] INFO: Processing task `misfit_and_gradient`
[2023-11-29 20:10:19,969] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:20,094] INFO: 
Iteration 0: Number of events: 1	 chi = 3.7156536966723097e-10	 ||g|| = 3.3910359372571976e-12
pred = ---	ared = ---	norm_update = ---	tr_radius = ---
[2023-11-29 20:10:20,097] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:20,097] INFO: Processing task `misfit`
[2023-11-29 20:10:20,123] INFO: Submitting job ...
[2023-11-29 20:10:20,168] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:20,168] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2023-11-29 20:10:21,180] INFO: Processing task `misfit`
[2023-11-29 20:10:21,283] INFO: 
old misfit control group: 3.7156536966723097e-10
new misfit control group: 1.073889989952079e-10
predicted reduction control group: -2.1653942143243586e-10
actual reduction control group: -2.6417637067202306e-10
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:21,283] INFO: 
Model update accepted.
[2023-11-29 20:10:21,284] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:21,284] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:21,295] INFO: Succesfully completed iteration #0.
[2023-11-29 20:10:21,296] INFO: Adding new iteration #1.
[2023-11-29 20:10:21,300] INFO: Resuming iteration #1.

[2023-11-29 20:10:21,304] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:21,304] INFO: Processing task `gradient`
[2023-11-29 20:10:21,369] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010371298_074819ef24@local
[2023-11-29 20:10:21,411] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:21,411] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2023-11-29 20:10:22,413] INFO: Processing task `gradient`
[2023-11-29 20:10:22,455] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:22,579] INFO: 
Iteration 1: Number of events: 1	 chi = 1.073889989952079e-10	 ||g|| = 1.037229670389857e-12
pred = -2.1653942143243586e-10	ared = -2.6417637067202306e-10	norm_update = 127.71284376748982	tr_radius = 127.71284376748997
[2023-11-29 20:10:22,587] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:22,587] INFO: Processing task `misfit`
[2023-11-29 20:10:22,612] INFO: Submitting job ...
[2023-11-29 20:10:22,658] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:22,658] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2023-11-29 20:10:23,669] INFO: Processing task `misfit`
[2023-11-29 20:10:23,698] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2023-11-29 20:10:24,709] INFO: Processing task `misfit`
[2023-11-29 20:10:24,743] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2023-11-29 20:10:25,750] INFO: Processing task `misfit`
[2023-11-29 20:10:25,865] INFO: 
old misfit control group: 1.073889989952079e-10
new misfit control group: 7.296709075757565e-11
predicted reduction control group: -1.886436638060351e-11
actual reduction control group: -3.442190823763225e-11
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:25,865] INFO: 
Model update accepted.
[2023-11-29 20:10:25,865] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:25,866] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:25,877] INFO: Succesfully completed iteration #1.
[2023-11-29 20:10:25,879] INFO: Adding new iteration #2.
[2023-11-29 20:10:25,883] INFO: Resuming iteration #2.

[2023-11-29 20:10:25,884] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:25,884] INFO: Processing task `gradient`
[2023-11-29 20:10:25,948] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010950070_22fa6ebfba@local
[2023-11-29 20:10:25,991] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:25,991] INFO: Some tasks of iteration #2 are still running. Please check again later.
[2023-11-29 20:10:26,993] INFO: Processing task `gradient`
[2023-11-29 20:10:27,036] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:27,069] INFO: Some simulations are still running. Please check again to see if they are finished.
[2023-11-29 20:10:27,070] INFO: Some tasks of iteration #2 are still running. Please check again later.
[2023-11-29 20:10:28,072] INFO: Processing task `gradient`
[2023-11-29 20:10:28,116] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:28,239] INFO: 
Iteration 2: Number of events: 1	 chi = 7.296709075757565e-11	 ||g|| = 8.841255720378636e-13
pred = -1.886436638060351e-11	ared = -3.442190823763225e-11	norm_update = 38.055155588990125	tr_radius = 255.42568753497994
[2023-11-29 20:10:28,251] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:28,252] INFO: Processing task `misfit`
[2023-11-29 20:10:28,277] INFO: Submitting job ...
[2023-11-29 20:10:28,323] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:28,323] INFO: Some tasks of iteration #2 are still running. Please check again later.
[2023-11-29 20:10:29,336] INFO: Processing task `misfit`
[2023-11-29 20:10:29,447] INFO: 
old misfit control group: 7.296709075757565e-11
new misfit control group: 7.29921706188182e-12
predicted reduction control group: -5.3947833613705984e-11
actual reduction control group: -6.566787369569383e-11
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:29,448] INFO: 
Model update accepted.
[2023-11-29 20:10:29,448] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:29,448] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:29,460] INFO: Succesfully completed iteration #2.
[2023-11-29 20:10:29,462] INFO: Adding new iteration #3.
[2023-11-29 20:10:29,467] INFO: Resuming iteration #3.

[2023-11-29 20:10:29,468] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:29,468] INFO: Processing task `gradient`
[2023-11-29 20:10:29,531] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010533510_bbfa9ee087@local
[2023-11-29 20:10:29,574] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:29,574] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2023-11-29 20:10:30,576] INFO: Processing task `gradient`
[2023-11-29 20:10:30,619] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:30,650] INFO: Some simulations are still running. Please check again to see if they are finished.
[2023-11-29 20:10:30,651] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2023-11-29 20:10:31,654] INFO: Processing task `gradient`
[2023-11-29 20:10:31,696] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:31,821] INFO: 
Iteration 3: Number of events: 1	 chi = 7.29921706188182e-12	 ||g|| = 2.1080709923504721e-13
pred = -5.3947833613705984e-11	ared = -6.566787369569383e-11	norm_update = 127.71284376748984	tr_radius = 127.71284376748997
[2023-11-29 20:10:31,839] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:31,840] INFO: Processing task `misfit`
[2023-11-29 20:10:31,866] INFO: Submitting job ...
[2023-11-29 20:10:31,911] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:31,912] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2023-11-29 20:10:32,925] INFO: Processing task `misfit`
[2023-11-29 20:10:32,962] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2023-11-29 20:10:33,971] INFO: Processing task `misfit`
[2023-11-29 20:10:34,084] INFO: 
old misfit control group: 7.29921706188182e-12
new misfit control group: 3.853990185690102e-12
predicted reduction control group: -3.625527296947774e-12
actual reduction control group: -3.4452268761917177e-12
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:34,084] INFO: 
Model update accepted.
[2023-11-29 20:10:34,085] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:34,085] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:34,098] INFO: Succesfully completed iteration #3.
[2023-11-29 20:10:34,100] INFO: Adding new iteration #4.
[2023-11-29 20:10:34,107] INFO: Resuming iteration #4.

[2023-11-29 20:10:34,110] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:34,111] INFO: Processing task `gradient`
[2023-11-29 20:10:34,176] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010178882_15d06af9a7@local
[2023-11-29 20:10:34,221] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:34,221] INFO: Some tasks of iteration #4 are still running. Please check again later.
[2023-11-29 20:10:35,224] INFO: Processing task `gradient`
[2023-11-29 20:10:35,268] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:35,388] INFO: 
Iteration 4: Number of events: 1	 chi = 3.853990185690102e-12	 ||g|| = 5.491251362114438e-14
pred = -3.625527296947774e-12	ared = -3.4452268761917177e-12	norm_update = 37.634593986576924	tr_radius = 255.42568753497994
[2023-11-29 20:10:35,412] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:35,413] INFO: Processing task `misfit`
[2023-11-29 20:10:35,438] INFO: Submitting job ...
[2023-11-29 20:10:35,482] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:35,483] INFO: Some tasks of iteration #4 are still running. Please check again later.
[2023-11-29 20:10:36,495] INFO: Processing task `misfit`
[2023-11-29 20:10:36,531] INFO: Some tasks of iteration #4 are still running. Please check again later.
[2023-11-29 20:10:37,541] INFO: Processing task `misfit`
[2023-11-29 20:10:37,643] INFO: 
old misfit control group: 3.853990185690102e-12
new misfit control group: 3.660798440136839e-12
predicted reduction control group: -1.1394903979292904e-13
actual reduction control group: -1.9319174555326333e-13
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:37,643] INFO: 
Model update accepted.
[2023-11-29 20:10:37,643] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:37,644] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:37,658] INFO: Succesfully completed iteration #4.
[2023-11-29 20:10:37,661] INFO: Adding new iteration #5.
[2023-11-29 20:10:37,670] INFO: Resuming iteration #5.

[2023-11-29 20:10:37,671] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:37,671] INFO: Processing task `gradient`
[2023-11-29 20:10:37,736] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010738136_a4e1b598f1@local
[2023-11-29 20:10:37,781] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:37,782] INFO: Some tasks of iteration #5 are still running. Please check again later.
[2023-11-29 20:10:38,785] INFO: Processing task `gradient`
[2023-11-29 20:10:38,828] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:38,866] INFO: Some simulations are still running. Please check again to see if they are finished.
[2023-11-29 20:10:38,867] INFO: Some tasks of iteration #5 are still running. Please check again later.
[2023-11-29 20:10:39,871] INFO: Processing task `gradient`
[2023-11-29 20:10:39,916] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:40,049] INFO: 
Iteration 5: Number of events: 1	 chi = 3.660798440136839e-12	 ||g|| = 3.682525298193585e-14
pred = -1.1394903979292904e-13	ared = -1.9319174555326333e-13	norm_update = 4.998974676234866	tr_radius = 127.71284376748997
[2023-11-29 20:10:40,078] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:40,078] INFO: Processing task `misfit`
[2023-11-29 20:10:40,100] INFO: Submitting job ...
[2023-11-29 20:10:40,147] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:40,147] INFO: Some tasks of iteration #5 are still running. Please check again later.
[2023-11-29 20:10:41,162] INFO: Processing task `misfit`
[2023-11-29 20:10:41,265] INFO: 
old misfit control group: 3.660798440136839e-12
new misfit control group: 2.9810284223434555e-12
predicted reduction control group: -4.4323683818356934e-13
actual reduction control group: -6.797700177933832e-13
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:41,265] INFO: 
Model update accepted.
[2023-11-29 20:10:41,266] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:41,266] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:41,280] INFO: Succesfully completed iteration #5.
[2023-11-29 20:10:41,282] INFO: Adding new iteration #6.
[2023-11-29 20:10:41,292] INFO: Resuming iteration #6.

[2023-11-29 20:10:41,292] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:41,294] INFO: Processing task `gradient`
[2023-11-29 20:10:41,360] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010362522_ead1865a35@local
[2023-11-29 20:10:41,402] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:41,403] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2023-11-29 20:10:42,406] INFO: Processing task `gradient`
[2023-11-29 20:10:42,451] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:42,482] INFO: Some simulations are still running. Please check again to see if they are finished.
[2023-11-29 20:10:42,483] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2023-11-29 20:10:43,488] INFO: Processing task `gradient`
[2023-11-29 20:10:43,532] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:43,564] INFO: Some simulations are still running. Please check again to see if they are finished.
[2023-11-29 20:10:43,565] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2023-11-29 20:10:44,570] INFO: Processing task `gradient`
[2023-11-29 20:10:44,610] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:44,750] INFO: 
Iteration 6: Number of events: 1	 chi = 2.9810284223434555e-12	 ||g|| = 1.1334072418867954e-13
pred = -4.4323683818356934e-13	ared = -6.797700177933832e-13	norm_update = 25.945609247270596	tr_radius = 63.856421883744986
[2023-11-29 20:10:44,784] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:44,785] INFO: Processing task `misfit`
[2023-11-29 20:10:44,810] INFO: Submitting job ...
[2023-11-29 20:10:44,854] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:44,854] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2023-11-29 20:10:45,868] INFO: Processing task `misfit`
[2023-11-29 20:10:45,988] INFO: 
old misfit control group: 2.9810284223434555e-12
new misfit control group: 1.9555860418200896e-12
predicted reduction control group: -6.673080610254194e-13
actual reduction control group: -1.025442380523366e-12
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:45,988] INFO: 
Model update accepted.
[2023-11-29 20:10:45,989] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:45,989] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:46,005] INFO: Succesfully completed iteration #6.
[2023-11-29 20:10:46,008] INFO: Adding new iteration #7.
[2023-11-29 20:10:46,021] INFO: Resuming iteration #7.

[2023-11-29 20:10:46,021] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:46,021] INFO: Processing task `gradient`
[2023-11-29 20:10:46,087] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010089162_dbcd40d875@local
[2023-11-29 20:10:46,129] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:46,129] INFO: Some tasks of iteration #7 are still running. Please check again later.
[2023-11-29 20:10:47,133] INFO: Processing task `gradient`
[2023-11-29 20:10:47,177] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:47,297] INFO: 
Iteration 7: Number of events: 1	 chi = 1.9555860418200896e-12	 ||g|| = 1.8082278362551017e-13
pred = -6.673080610254194e-13	ared = -1.025442380523366e-12	norm_update = 51.891218494541064	tr_radius = 51.89121849454119
[2023-11-29 20:10:47,337] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:47,337] INFO: Processing task `misfit`
[2023-11-29 20:10:47,362] INFO: Submitting job ...
[2023-11-29 20:10:47,539] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:47,540] INFO: Some tasks of iteration #7 are still running. Please check again later.
[2023-11-29 20:10:48,552] INFO: Processing task `misfit`
[2023-11-29 20:10:48,668] INFO: 
old misfit control group: 1.9555860418200896e-12
new misfit control group: 7.195492692978477e-13
predicted reduction control group: -8.887018361461577e-13
actual reduction control group: -1.2360367725222419e-12
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:48,668] INFO: 
Model update accepted.
[2023-11-29 20:10:48,669] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:48,669] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:48,684] INFO: Succesfully completed iteration #7.
[2023-11-29 20:10:48,687] INFO: Adding new iteration #8.
[2023-11-29 20:10:48,701] INFO: Resuming iteration #8.

[2023-11-29 20:10:48,701] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:48,702] INFO: Processing task `gradient`
[2023-11-29 20:10:48,768] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2311292010769888_bb959ec378@local
[2023-11-29 20:10:48,811] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:48,811] INFO: Some tasks of iteration #8 are still running. Please check again later.
[2023-11-29 20:10:49,815] INFO: Processing task `gradient`
[2023-11-29 20:10:49,858] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:49,893] INFO: Some simulations are still running. Please check again to see if they are finished.
[2023-11-29 20:10:49,893] INFO: Some tasks of iteration #8 are still running. Please check again later.
[2023-11-29 20:10:50,899] INFO: Processing task `gradient`
[2023-11-29 20:10:50,943] INFO: 1 events have already been submitted. They will not be submitted again.
[2023-11-29 20:10:51,079] INFO: 
Iteration 8: Number of events: 1	 chi = 7.195492692978477e-13	 ||g|| = 1.668305656509431e-13
pred = -8.887018361461577e-13	ared = -1.2360367725222419e-12	norm_update = 83.04605740553336	tr_radius = 103.78243698908238
[2023-11-29 20:10:51,123] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:51,123] INFO: Processing task `misfit`
[2023-11-29 20:10:51,146] INFO: Submitting job ...
[2023-11-29 20:10:51,192] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2023-11-29 20:10:51,192] INFO: Some tasks of iteration #8 are still running. Please check again later.
[2023-11-29 20:10:52,207] INFO: Processing task `misfit`
[2023-11-29 20:10:52,309] INFO: 
old misfit control group: 7.195492692978477e-13
new misfit control group: 3.428681080907987e-14
predicted reduction control group: -5.160693460554207e-13
actual reduction control group: -6.852624584887678e-13
1 out of 1 event(s) improved the misfit.
[2023-11-29 20:10:52,310] INFO: 
Model update accepted.
[2023-11-29 20:10:52,310] INFO: 1 new tasks have been issued.
[2023-11-29 20:10:52,310] INFO: Processing task `finalize_iteration`
[2023-11-29 20:10:52,326] INFO: Succesfully completed iteration #8.
[2023-11-29 20:10:52,330] INFO: Adding new iteration #9.
[2023-11-29 20:10:52,345] INFO: Resuming iteration #9.

[2023-11-29 20:10:52,346] INFO: The total number of iterations in this inversion tree has been reached and no new iteration will be added. If you want to continue with this inversion, you need to adjust `max_iterations_global` using `set_stopping_criteria`.
Finally, we load the final model and check that it indeed converged to the true model. The reconstruction matches the true model with less than 0.1% error for compressional and shear wave speed and less than 0.2% for density.
p.viz.nb.inversion(inverse_problem_configuration="inversion")