Version:
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.list(),
        site_name=SALVUS_FLOW_SITE_NAME,
        ranks_per_job=1,
    )
[2024-11-06 22:37:36,882] INFO: Creating mesh. Hang on.
[2024-11-06 22:37:36,918] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237020956_56f0635cf9@local
[2024-11-06 22:37:37,090] INFO: Creating mesh. Hang on.
[2024-11-06 22:37:37,119] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237122251_f6c921ecbf@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,
    )
[2024-11-06 22:37:38,191] INFO: Adding new iteration #0.
[2024-11-06 22:37:38,198] INFO: Resuming iteration #0.

[2024-11-06 22:37:38,198] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:38,199] INFO: Processing task `misfit_and_gradient`
[2024-11-06 22:37:38,210] 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']
[2024-11-06 22:37:38,220] INFO: Submitting job ...
[2024-11-06 22:37:38,265] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:38,266] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2024-11-06 22:37:39,267] INFO: Processing task `misfit_and_gradient`
[2024-11-06 22:37:39,321] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2024-11-06 22:37:40,322] INFO: Processing task `misfit_and_gradient`
[2024-11-06 22:37:40,526] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237528075_307f65c655@local
[2024-11-06 22:37:40,565] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:40,566] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2024-11-06 22:37:41,567] INFO: Processing task `misfit_and_gradient`
[2024-11-06 22:37:41,629] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:37:41,658] INFO: Some simulations are still running. Please check again to see if they are finished.
[2024-11-06 22:37:41,658] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2024-11-06 22:37:42,659] INFO: Processing task `misfit_and_gradient`
[2024-11-06 22:37:42,737] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:37:42,842] INFO: 
Iteration 0: Number of events: 1	 chi = 3.7156536966723097e-10	 ||g|| = 3.3910359372571976e-12
pred = ---	ared = ---	norm_update = ---	tr_radius = ---
[2024-11-06 22:37:42,845] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:42,845] INFO: Processing task `misfit`
[2024-11-06 22:37:42,865] INFO: Submitting job ...
[2024-11-06 22:37:42,907] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:42,907] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2024-11-06 22:37:43,917] INFO: Processing task `misfit`
[2024-11-06 22:37:43,951] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2024-11-06 22:37:44,963] INFO: Processing task `misfit`
[2024-11-06 22:37:45,083] 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.
[2024-11-06 22:37:45,083] INFO: 
Model update accepted.
[2024-11-06 22:37:45,083] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:45,083] INFO: Processing task `finalize_iteration`
[2024-11-06 22:37:45,109] INFO: Succesfully completed iteration #0.
[2024-11-06 22:37:45,111] INFO: Adding new iteration #1.
[2024-11-06 22:37:45,116] INFO: Resuming iteration #1.

[2024-11-06 22:37:45,116] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:45,116] INFO: Processing task `gradient`
[2024-11-06 22:37:45,162] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237163652_bb4d57b581@local
[2024-11-06 22:37:45,200] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:45,200] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2024-11-06 22:37:46,201] INFO: Processing task `gradient`
[2024-11-06 22:37:46,244] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:37:46,354] 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
[2024-11-06 22:37:46,362] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:46,362] INFO: Processing task `misfit`
[2024-11-06 22:37:46,384] INFO: Submitting job ...
[2024-11-06 22:37:46,428] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:46,429] INFO: Some tasks of iteration #1 are still running. Please check again later.
[2024-11-06 22:37:47,439] INFO: Processing task `misfit`
[2024-11-06 22:37:47,546] 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.
[2024-11-06 22:37:47,546] INFO: 
Model update accepted.
[2024-11-06 22:37:47,547] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:47,547] INFO: Processing task `finalize_iteration`
[2024-11-06 22:37:47,566] INFO: Succesfully completed iteration #1.
[2024-11-06 22:37:47,569] INFO: Adding new iteration #2.
[2024-11-06 22:37:47,573] INFO: Resuming iteration #2.

[2024-11-06 22:37:47,574] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:47,574] INFO: Processing task `gradient`
[2024-11-06 22:37:47,620] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237622023_f8d009633d@local
[2024-11-06 22:37:47,663] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:47,663] INFO: Some tasks of iteration #2 are still running. Please check again later.
[2024-11-06 22:37:48,665] INFO: Processing task `gradient`
[2024-11-06 22:37:48,714] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:37:48,837] 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
[2024-11-06 22:37:48,849] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:48,850] INFO: Processing task `misfit`
[2024-11-06 22:37:48,874] INFO: Submitting job ...
[2024-11-06 22:37:48,916] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:48,916] INFO: Some tasks of iteration #2 are still running. Please check again later.
[2024-11-06 22:37:49,926] INFO: Processing task `misfit`
[2024-11-06 22:37:50,171] 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.
[2024-11-06 22:37:50,172] INFO: 
Model update accepted.
[2024-11-06 22:37:50,172] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:50,172] INFO: Processing task `finalize_iteration`
[2024-11-06 22:37:50,191] INFO: Succesfully completed iteration #2.
[2024-11-06 22:37:50,193] INFO: Adding new iteration #3.
[2024-11-06 22:37:50,198] INFO: Resuming iteration #3.

[2024-11-06 22:37:50,198] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:50,199] INFO: Processing task `gradient`
[2024-11-06 22:37:50,245] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237247094_ae9f4bfc8a@local
[2024-11-06 22:37:50,284] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:50,284] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2024-11-06 22:37:51,286] INFO: Processing task `gradient`
[2024-11-06 22:37:51,313] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:37:51,419] 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
[2024-11-06 22:37:51,438] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:51,438] INFO: Processing task `misfit`
[2024-11-06 22:37:51,462] INFO: Submitting job ...
[2024-11-06 22:37:51,502] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:51,502] INFO: Some tasks of iteration #3 are still running. Please check again later.
[2024-11-06 22:37:52,513] INFO: Processing task `misfit`
[2024-11-06 22:37:52,619] 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.
[2024-11-06 22:37:52,620] INFO: 
Model update accepted.
[2024-11-06 22:37:52,620] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:52,620] INFO: Processing task `finalize_iteration`
[2024-11-06 22:37:52,642] INFO: Succesfully completed iteration #3.
[2024-11-06 22:37:52,644] INFO: Adding new iteration #4.
[2024-11-06 22:37:52,650] INFO: Resuming iteration #4.

[2024-11-06 22:37:52,651] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:52,651] INFO: Processing task `gradient`
[2024-11-06 22:37:52,697] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237698711_c2efc64bbc@local
[2024-11-06 22:37:52,738] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:52,739] INFO: Some tasks of iteration #4 are still running. Please check again later.
[2024-11-06 22:37:53,741] INFO: Processing task `gradient`
[2024-11-06 22:37:53,783] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:37:53,889] 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
[2024-11-06 22:37:53,913] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:53,913] INFO: Processing task `misfit`
[2024-11-06 22:37:53,935] INFO: Submitting job ...
[2024-11-06 22:37:53,976] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:53,977] INFO: Some tasks of iteration #4 are still running. Please check again later.
[2024-11-06 22:37:54,988] INFO: Processing task `misfit`
[2024-11-06 22:37:55,107] 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.
[2024-11-06 22:37:55,107] INFO: 
Model update accepted.
[2024-11-06 22:37:55,108] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:55,108] INFO: Processing task `finalize_iteration`
[2024-11-06 22:37:55,129] INFO: Succesfully completed iteration #4.
[2024-11-06 22:37:55,132] INFO: Adding new iteration #5.
[2024-11-06 22:37:55,140] INFO: Resuming iteration #5.

[2024-11-06 22:37:55,140] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:55,140] INFO: Processing task `gradient`
[2024-11-06 22:37:55,186] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237188490_58905ecd6d@local
[2024-11-06 22:37:55,227] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:55,227] INFO: Some tasks of iteration #5 are still running. Please check again later.
[2024-11-06 22:37:56,230] INFO: Processing task `gradient`
[2024-11-06 22:37:56,263] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:37:56,372] 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
[2024-11-06 22:37:56,401] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:56,401] INFO: Processing task `misfit`
[2024-11-06 22:37:56,420] INFO: Submitting job ...
[2024-11-06 22:37:56,465] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:56,465] INFO: Some tasks of iteration #5 are still running. Please check again later.
[2024-11-06 22:37:57,476] INFO: Processing task `misfit`
[2024-11-06 22:37:57,521] INFO: Some tasks of iteration #5 are still running. Please check again later.
[2024-11-06 22:37:58,541] INFO: Processing task `misfit`
[2024-11-06 22:37:58,651] 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.
[2024-11-06 22:37:58,652] INFO: 
Model update accepted.
[2024-11-06 22:37:58,652] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:58,652] INFO: Processing task `finalize_iteration`
[2024-11-06 22:37:58,672] INFO: Succesfully completed iteration #5.
[2024-11-06 22:37:58,674] INFO: Adding new iteration #6.
[2024-11-06 22:37:58,682] INFO: Resuming iteration #6.

[2024-11-06 22:37:58,682] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:58,683] INFO: Processing task `gradient`
[2024-11-06 22:37:58,741] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062237743246_53087f4aa1@local
[2024-11-06 22:37:58,782] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:37:58,782] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2024-11-06 22:37:59,785] INFO: Processing task `gradient`
[2024-11-06 22:37:59,813] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:37:59,919] 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
[2024-11-06 22:37:59,958] INFO: 1 new tasks have been issued.
[2024-11-06 22:37:59,958] INFO: Processing task `misfit`
[2024-11-06 22:37:59,981] INFO: Submitting job ...
[2024-11-06 22:38:00,021] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:38:00,021] INFO: Some tasks of iteration #6 are still running. Please check again later.
[2024-11-06 22:38:01,034] INFO: Processing task `misfit`
[2024-11-06 22:38:01,141] 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.
[2024-11-06 22:38:01,141] INFO: 
Model update accepted.
[2024-11-06 22:38:01,142] INFO: 1 new tasks have been issued.
[2024-11-06 22:38:01,142] INFO: Processing task `finalize_iteration`
[2024-11-06 22:38:01,166] INFO: Succesfully completed iteration #6.
[2024-11-06 22:38:01,169] INFO: Adding new iteration #7.
[2024-11-06 22:38:01,179] INFO: Resuming iteration #7.

[2024-11-06 22:38:01,179] INFO: 1 new tasks have been issued.
[2024-11-06 22:38:01,179] INFO: Processing task `gradient`
[2024-11-06 22:38:01,224] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062238226705_d8e01418f0@local
[2024-11-06 22:38:01,266] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:38:01,266] INFO: Some tasks of iteration #7 are still running. Please check again later.
[2024-11-06 22:38:02,268] INFO: Processing task `gradient`
[2024-11-06 22:38:02,311] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:38:02,428] 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
[2024-11-06 22:38:02,464] INFO: 1 new tasks have been issued.
[2024-11-06 22:38:02,465] INFO: Processing task `misfit`
[2024-11-06 22:38:02,484] INFO: Submitting job ...
[2024-11-06 22:38:02,527] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:38:02,527] INFO: Some tasks of iteration #7 are still running. Please check again later.
[2024-11-06 22:38:03,538] INFO: Processing task `misfit`
[2024-11-06 22:38:03,643] 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.
[2024-11-06 22:38:03,643] INFO: 
Model update accepted.
[2024-11-06 22:38:03,643] INFO: 1 new tasks have been issued.
[2024-11-06 22:38:03,644] INFO: Processing task `finalize_iteration`
[2024-11-06 22:38:03,670] INFO: Succesfully completed iteration #7.
[2024-11-06 22:38:03,673] INFO: Adding new iteration #8.
[2024-11-06 22:38:03,686] INFO: Resuming iteration #8.

[2024-11-06 22:38:03,686] INFO: 1 new tasks have been issued.
[2024-11-06 22:38:03,686] INFO: Processing task `gradient`
[2024-11-06 22:38:03,739] INFO: Submitting job ...
Uploading 1 files...

🚀  Submitted job_2411062238740899_2a6125d6ac@local
[2024-11-06 22:38:03,779] INFO: Launched adjoint simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:38:03,779] INFO: Some tasks of iteration #8 are still running. Please check again later.
[2024-11-06 22:38:04,783] INFO: Processing task `gradient`
[2024-11-06 22:38:04,810] INFO: 1 events have already been submitted. They will not be submitted again.
[2024-11-06 22:38:04,923] 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
[2024-11-06 22:38:04,966] INFO: 1 new tasks have been issued.
[2024-11-06 22:38:04,966] INFO: Processing task `misfit`
[2024-11-06 22:38:04,989] INFO: Submitting job ...
[2024-11-06 22:38:05,033] INFO: Launched simulations for 1 events. Please check again to see if they are finished.
[2024-11-06 22:38:05,034] INFO: Some tasks of iteration #8 are still running. Please check again later.
[2024-11-06 22:38:06,047] INFO: Processing task `misfit`
[2024-11-06 22:38:06,157] 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.
[2024-11-06 22:38:06,158] INFO: 
Model update accepted.
[2024-11-06 22:38:06,158] INFO: 1 new tasks have been issued.
[2024-11-06 22:38:06,159] INFO: Processing task `finalize_iteration`
[2024-11-06 22:38:06,186] INFO: Succesfully completed iteration #8.
[2024-11-06 22:38:06,190] INFO: Adding new iteration #9.
[2024-11-06 22:38:06,202] INFO: Resuming iteration #9.

[2024-11-06 22:38:06,202] 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")