%matplotlib inline
# This notebook will use this variable to determine which
# remote site to run on.
import os
import numpy as np
import salvus.namespace as sn
SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")
p = sn.Project(path="project")
6.5 cm
as the target region.mesh = p.simulations.get_mesh(simulation_configuration="initial_model")
# define the region of interest
roi = np.zeros_like(mesh.connectivity)
mask = np.linalg.norm(mesh.points[mesh.connectivity], axis=2) < 0.065
roi[mask] = 1.0
mesh.attach_field("region_of_interest", roi)
p += sn.InverseProblemConfiguration(
name="my_second_inversion",
prior_model="initial_model",
events=p.events.list(),
mapping=sn.Mapping(
scaling="absolute",
inversion_parameters=["VP", "RHO"],
region_of_interest=mesh,
),
preconditioner=sn.ConstantSmoothing({"VP": 0.01, "RHO": 0.01}),
method=sn.TrustRegion(initial_trust_region_linf=10.0),
misfit_configuration="L2",
wavefield_compression=sn.WavefieldCompression(
forward_wavefield_sampling_interval=10
),
job_submission=sn.SiteConfig(
site_name=SALVUS_FLOW_SITE_NAME, ranks_per_job=4
),
)
p.inversions.iterate(
inverse_problem_configuration="my_second_inversion",
timeout_in_seconds=360,
ping_interval_in_seconds=10,
delete_disposable_files="all",
)
[2025-01-09 22:06:35,191] INFO: Adding new iteration #0. [2025-01-09 22:06:35,206] INFO: Resuming iteration #0. [2025-01-09 22:06:35,206] INFO: 1 new tasks have been issued. [2025-01-09 22:06:35,207] INFO: Processing task `misfit_and_gradient` [2025-01-09 22:06:35,501] INFO: Iteration 0: Number of events: 5 chi = 0.018681064754203797 ||g|| = 0.016366358801050206 pred = --- ared = --- norm_update = --- tr_radius = --- [2025-01-09 22:06:35,502] INFO: 1 new tasks have been issued. [2025-01-09 22:06:35,502] INFO: Processing task `preconditioner` [2025-01-09 22:06:35,663] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:06:45,676] INFO: Processing task `preconditioner` [2025-01-09 22:06:45,818] INFO: 1 new tasks have been issued. [2025-01-09 22:06:45,819] INFO: Processing task `misfit` [2025-01-09 22:06:45,867] INFO: Submitting job array with 5 jobs ... [2025-01-09 22:06:45,969] INFO: Launched simulations for 5 events. Please check again to see if they are finished. [2025-01-09 22:06:45,970] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:06:56,002] INFO: Processing task `misfit` [2025-01-09 22:06:58,189] INFO: old misfit control group: 0.018681064754203797 new misfit control group: 0.007802509365775308 predicted reduction control group: -0.005675405778715309 actual reduction control group: -0.010878555388428489 5 out of 5 event(s) improved the misfit. [2025-01-09 22:06:58,190] INFO: Model update accepted. [2025-01-09 22:06:58,190] INFO: 1 new tasks have been issued. [2025-01-09 22:06:58,191] INFO: Processing task `finalize_iteration` [2025-01-09 22:06:58,260] INFO: ... searching for obsolete files in project/INVERSIONS/my_second_inversion/00000 [2025-01-09 22:06:58,278] INFO: Freed up 1.2 MB of space. [2025-01-09 22:06:58,279] INFO: Succesfully completed iteration #0. [2025-01-09 22:06:58,281] INFO: Adding new iteration #1.
p.viz.nb.inversion(inverse_problem_configuration="my_second_inversion")
for i in range(2):
p.inversions.iterate(
inverse_problem_configuration="my_second_inversion",
timeout_in_seconds=360,
ping_interval_in_seconds=10,
delete_disposable_files="all",
)
p.viz.nb.inversion(inverse_problem_configuration="my_second_inversion")
[2025-01-09 22:06:59,446] INFO: Resuming iteration #1. [2025-01-09 22:06:59,446] INFO: 1 new tasks have been issued. [2025-01-09 22:06:59,447] INFO: Processing task `gradient` [2025-01-09 22:06:59,661] INFO: Submitting job array with 5 jobs ...
Uploading 1 files... Uploading 1 files... Uploading 1 files... Uploading 1 files... Uploading 1 files... [2025-01-09 22:06:59,724] INFO: Launched adjoint simulations for 5 events. Please check again to see if they are finished. [2025-01-09 22:06:59,726] INFO: Some tasks of iteration #1 are still running. Please check again later. [2025-01-09 22:07:09,728] INFO: Processing task `gradient` [2025-01-09 22:07:10,192] INFO: 5 events have already been submitted. They will not be submitted again. [2025-01-09 22:07:10,658] INFO: Iteration 1: Number of events: 5 chi = 0.0078025093657753085 ||g|| = 0.008438424180558228 pred = -0.005675405778715309 ared = -0.010878555388428489 norm_update = 0.7166324367619695 tr_radius = 0.7166322852767166 [2025-01-09 22:07:10,670] INFO: 1 new tasks have been issued. [2025-01-09 22:07:10,671] INFO: Processing task `preconditioner` [2025-01-09 22:07:10,769] INFO: Some tasks of iteration #1 are still running. Please check again later. [2025-01-09 22:07:20,794] INFO: Processing task `preconditioner` [2025-01-09 22:07:20,944] INFO: 1 new tasks have been issued. [2025-01-09 22:07:20,945] INFO: Processing task `misfit` [2025-01-09 22:07:20,992] INFO: Submitting job array with 5 jobs ... [2025-01-09 22:07:21,104] INFO: Launched simulations for 5 events. Please check again to see if they are finished. [2025-01-09 22:07:21,106] INFO: Some tasks of iteration #1 are still running. Please check again later. [2025-01-09 22:07:31,146] INFO: Processing task `misfit` [2025-01-09 22:07:32,816] INFO: old misfit control group: 0.007802509365775308 new misfit control group: 0.0038977169133135496 predicted reduction control group: -0.0029460718526640095 actual reduction control group: -0.003904792452461758 5 out of 5 event(s) improved the misfit. [2025-01-09 22:07:32,817] INFO: Model update accepted. [2025-01-09 22:07:32,817] INFO: 1 new tasks have been issued. [2025-01-09 22:07:32,817] INFO: Processing task `finalize_iteration` [2025-01-09 22:07:32,903] INFO: ... searching for obsolete files in project/INVERSIONS/my_second_inversion/00001 [2025-01-09 22:07:33,038] INFO: Freed up 4.8 MB of space. [2025-01-09 22:07:33,039] INFO: Succesfully completed iteration #1. [2025-01-09 22:07:33,041] INFO: Adding new iteration #2. [2025-01-09 22:07:33,051] INFO: Resuming iteration #2. [2025-01-09 22:07:33,051] INFO: 1 new tasks have been issued. [2025-01-09 22:07:33,052] INFO: Processing task `gradient` [2025-01-09 22:07:33,273] INFO: Submitting job array with 5 jobs ...
Uploading 1 files... Uploading 1 files... Uploading 1 files... Uploading 1 files... Uploading 1 files... [2025-01-09 22:07:33,338] INFO: Launched adjoint simulations for 5 events. Please check again to see if they are finished. [2025-01-09 22:07:33,346] INFO: Some tasks of iteration #2 are still running. Please check again later. [2025-01-09 22:07:43,348] INFO: Processing task `gradient` [2025-01-09 22:07:43,524] INFO: 5 events have already been submitted. They will not be submitted again. [2025-01-09 22:07:43,962] INFO: Iteration 2: Number of events: 5 chi = 0.0038977169133135496 ||g|| = 0.0038998099223934266 pred = -0.0029460718526640095 ared = -0.003904792452461758 norm_update = 0.7368817080094618 tr_radius = 1.4332645705534333 [2025-01-09 22:07:43,978] INFO: 1 new tasks have been issued. [2025-01-09 22:07:43,978] INFO: Processing task `preconditioner` [2025-01-09 22:07:44,078] INFO: Some tasks of iteration #2 are still running. Please check again later. [2025-01-09 22:07:54,113] INFO: Processing task `preconditioner` [2025-01-09 22:07:54,301] INFO: 1 new tasks have been issued. [2025-01-09 22:07:54,302] INFO: Processing task `misfit` [2025-01-09 22:07:54,348] INFO: Submitting job array with 5 jobs ... [2025-01-09 22:07:54,454] INFO: Launched simulations for 5 events. Please check again to see if they are finished. [2025-01-09 22:07:54,456] INFO: Some tasks of iteration #2 are still running. Please check again later. [2025-01-09 22:08:04,506] INFO: Processing task `misfit` [2025-01-09 22:08:06,287] INFO: old misfit control group: 0.0038977169133135496 new misfit control group: 0.003293527922292616 predicted reduction control group: -0.00027362868818550537 actual reduction control group: -0.0006041889910209336 5 out of 5 event(s) improved the misfit. [2025-01-09 22:08:06,287] INFO: Model update accepted. [2025-01-09 22:08:06,288] INFO: 1 new tasks have been issued. [2025-01-09 22:08:06,288] INFO: Processing task `finalize_iteration` [2025-01-09 22:08:06,383] INFO: ... searching for obsolete files in project/INVERSIONS/my_second_inversion/00002 [2025-01-09 22:08:06,510] INFO: Freed up 6.0 MB of space. [2025-01-09 22:08:06,510] INFO: Succesfully completed iteration #2. [2025-01-09 22:08:06,512] INFO: Adding new iteration #3.
VP
and RHO
, except for the
previously selected region of interest, where we restrict VP
updates to +/- 1 m/s.p += sn.InverseProblemConfiguration(
name="my_third_inversion",
prior_model="initial_model",
events=p.events.list(),
mapping=sn.Mapping(
scaling="absolute",
inversion_parameters=["VP", "RHO"],
),
preconditioner=sn.ConstantSmoothing({"VP": 0.01, "RHO": 0.01}),
method=sn.TrustRegion(initial_trust_region_linf=10.0),
misfit_configuration="L2",
wavefield_compression=sn.WavefieldCompression(
forward_wavefield_sampling_interval=10
),
job_submission=sn.SiteConfig(
site_name=SALVUS_FLOW_SITE_NAME, ranks_per_job=4
),
)
mesh = p.simulations.get_mesh("initial_model")
lb = mesh.copy()
ones = np.ones_like(lb.elemental_fields["VP"])
lb.elemental_fields["VP"] *= 0.8
lb.elemental_fields["RHO"] *= 0.8
lb.elemental_fields["VP"][roi < 0.5] = 1501.0
ub = mesh.copy()
ub.elemental_fields["VP"] *= 1.2
ub.elemental_fields["RHO"] *= 1.2
ub.elemental_fields["VP"][roi < 0.5] = 1502.0
p.inversions.set_constraints(
inverse_problem_configuration="my_third_inversion",
constraints={
"lower_bounds": lb,
"upper_bounds": ub,
},
)
p.inversions.iterate(
"my_third_inversion", timeout_in_seconds=360, delete_disposable_files="all"
)
p.viz.nb.inversion(inverse_problem_configuration="my_third_inversion")
[2025-01-09 22:08:07,364] INFO: Adding new iteration #0. [2025-01-09 22:08:07,375] INFO: Resuming iteration #0. [2025-01-09 22:08:07,376] INFO: 1 new tasks have been issued. [2025-01-09 22:08:07,376] INFO: Processing task `misfit_and_gradient` [2025-01-09 22:08:07,704] INFO: Iteration 0: Number of events: 5 chi = 0.018681064754203797 ||g|| = 0.022700663670338374 pred = --- ared = --- norm_update = --- tr_radius = --- [2025-01-09 22:08:07,705] INFO: 1 new tasks have been issued. [2025-01-09 22:08:07,705] INFO: Processing task `preconditioner` [2025-01-09 22:08:07,786] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:07,799] INFO: Processing task `preconditioner` [2025-01-09 22:08:07,839] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:07,852] INFO: Processing task `preconditioner` [2025-01-09 22:08:07,884] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:07,896] INFO: Processing task `preconditioner` [2025-01-09 22:08:07,939] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:07,958] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,011] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,028] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,072] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,088] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,131] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,147] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,191] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,210] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,258] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,275] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,320] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,338] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,386] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,407] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,462] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,481] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,534] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,551] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,603] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,622] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,674] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,696] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,749] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,766] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,820] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,842] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,894] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,917] INFO: Processing task `preconditioner` [2025-01-09 22:08:08,967] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:08,984] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,031] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,053] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,108] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,128] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,182] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,200] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,249] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,266] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,311] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,328] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,368] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,387] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,443] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,462] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,514] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,531] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,579] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,605] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,661] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,676] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,730] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,745] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,798] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,817] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,868] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,887] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,937] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:09,950] INFO: Processing task `preconditioner` [2025-01-09 22:08:09,994] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,008] INFO: Processing task `preconditioner` [2025-01-09 22:08:10,049] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,066] INFO: Processing task `preconditioner` [2025-01-09 22:08:10,114] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,126] INFO: Processing task `preconditioner` [2025-01-09 22:08:10,165] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,179] INFO: Processing task `preconditioner` [2025-01-09 22:08:10,231] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,243] INFO: Processing task `preconditioner` [2025-01-09 22:08:10,286] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,299] INFO: Processing task `preconditioner`
[2025-01-09 22:08:10,344] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,366] INFO: Processing task `preconditioner` [2025-01-09 22:08:10,493] INFO: 1 new tasks have been issued. [2025-01-09 22:08:10,493] INFO: Processing task `misfit` [2025-01-09 22:08:10,536] INFO: Submitting job array with 5 jobs ... [2025-01-09 22:08:10,635] INFO: Launched simulations for 5 events. Please check again to see if they are finished. [2025-01-09 22:08:10,636] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,663] INFO: Processing task `misfit` [2025-01-09 22:08:10,712] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,740] INFO: Processing task `misfit` [2025-01-09 22:08:10,812] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:10,846] INFO: Processing task `misfit` [2025-01-09 22:08:11,131] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,157] INFO: Processing task `misfit` [2025-01-09 22:08:11,213] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,235] INFO: Processing task `misfit` [2025-01-09 22:08:11,287] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,331] INFO: Processing task `misfit` [2025-01-09 22:08:11,398] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,433] INFO: Processing task `misfit` [2025-01-09 22:08:11,501] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,536] INFO: Processing task `misfit` [2025-01-09 22:08:11,603] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,637] INFO: Processing task `misfit` [2025-01-09 22:08:11,707] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,742] INFO: Processing task `misfit` [2025-01-09 22:08:11,811] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,845] INFO: Processing task `misfit` [2025-01-09 22:08:11,913] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:11,948] INFO: Processing task `misfit` [2025-01-09 22:08:12,018] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,043] INFO: Processing task `misfit` [2025-01-09 22:08:12,094] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,119] INFO: Processing task `misfit` [2025-01-09 22:08:12,174] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,199] INFO: Processing task `misfit` [2025-01-09 22:08:12,259] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,285] INFO: Processing task `misfit` [2025-01-09 22:08:12,336] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,362] INFO: Processing task `misfit` [2025-01-09 22:08:12,599] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,622] INFO: Processing task `misfit` [2025-01-09 22:08:12,688] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,713] INFO: Processing task `misfit` [2025-01-09 22:08:12,768] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,793] INFO: Processing task `misfit` [2025-01-09 22:08:12,846] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,871] INFO: Processing task `misfit` [2025-01-09 22:08:12,930] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:12,955] INFO: Processing task `misfit` [2025-01-09 22:08:13,006] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,031] INFO: Processing task `misfit` [2025-01-09 22:08:13,091] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,124] INFO: Processing task `misfit` [2025-01-09 22:08:13,182] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,215] INFO: Processing task `misfit` [2025-01-09 22:08:13,280] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,315] INFO: Processing task `misfit` [2025-01-09 22:08:13,384] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,418] INFO: Processing task `misfit` [2025-01-09 22:08:13,482] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,514] INFO: Processing task `misfit` [2025-01-09 22:08:13,563] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,586] INFO: Processing task `misfit` [2025-01-09 22:08:13,645] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,667] INFO: Processing task `misfit` [2025-01-09 22:08:13,719] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:13,742] INFO: Processing task `misfit` [2025-01-09 22:08:14,011] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,044] INFO: Processing task `misfit` [2025-01-09 22:08:14,109] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,137] INFO: Processing task `misfit` [2025-01-09 22:08:14,204] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,229] INFO: Processing task `misfit` [2025-01-09 22:08:14,287] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,316] INFO: Processing task `misfit` [2025-01-09 22:08:14,379] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,412] INFO: Processing task `misfit` [2025-01-09 22:08:14,479] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,512] INFO: Processing task `misfit` [2025-01-09 22:08:14,569] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,597] INFO: Processing task `misfit` [2025-01-09 22:08:14,666] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,700] INFO: Processing task `misfit` [2025-01-09 22:08:14,772] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,806] INFO: Processing task `misfit` [2025-01-09 22:08:14,869] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,904] INFO: Processing task `misfit`
[2025-01-09 22:08:14,965] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:14,998] INFO: Processing task `misfit` [2025-01-09 22:08:15,060] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,094] INFO: Processing task `misfit` [2025-01-09 22:08:15,158] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,190] INFO: Processing task `misfit` [2025-01-09 22:08:15,454] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,484] INFO: Processing task `misfit` [2025-01-09 22:08:15,536] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,565] INFO: Processing task `misfit` [2025-01-09 22:08:15,615] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,642] INFO: Processing task `misfit` [2025-01-09 22:08:15,694] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,730] INFO: Processing task `misfit` [2025-01-09 22:08:15,801] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,837] INFO: Processing task `misfit` [2025-01-09 22:08:15,892] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,919] INFO: Processing task `misfit` [2025-01-09 22:08:15,968] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:15,996] INFO: Processing task `misfit` [2025-01-09 22:08:16,065] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:16,092] INFO: Processing task `misfit` [2025-01-09 22:08:16,142] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:16,170] INFO: Processing task `misfit` [2025-01-09 22:08:16,217] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:16,243] INFO: Processing task `misfit` [2025-01-09 22:08:16,294] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:16,321] INFO: Processing task `misfit` [2025-01-09 22:08:16,373] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:16,409] INFO: Processing task `misfit` [2025-01-09 22:08:16,730] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:16,765] INFO: Processing task `misfit` [2025-01-09 22:08:16,826] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:16,857] INFO: Processing task `misfit` [2025-01-09 22:08:16,918] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:16,949] INFO: Processing task `misfit` [2025-01-09 22:08:17,011] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:17,041] INFO: Processing task `misfit` [2025-01-09 22:08:17,111] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:17,146] INFO: Processing task `misfit` [2025-01-09 22:08:17,213] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:17,249] INFO: Processing task `misfit` [2025-01-09 22:08:17,315] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:17,350] INFO: Processing task `misfit` [2025-01-09 22:08:19,010] INFO: old misfit control group: 0.018681064754203797 new misfit control group: 0.009266712628118857 predicted reduction control group: -0.005269264615522084 actual reduction control group: -0.00941435212608494 5 out of 5 event(s) improved the misfit. [2025-01-09 22:08:19,010] INFO: Model update accepted. [2025-01-09 22:08:19,011] INFO: 1 new tasks have been issued. [2025-01-09 22:08:19,011] INFO: Processing task `finalize_iteration` [2025-01-09 22:08:19,060] INFO: ... searching for obsolete files in project/INVERSIONS/my_third_inversion/00000 [2025-01-09 22:08:19,073] INFO: Freed up 1.2 MB of space. [2025-01-09 22:08:19,074] INFO: Succesfully completed iteration #0. [2025-01-09 22:08:19,076] INFO: Adding new iteration #1.
VP
, but use the following scaling relation for soft tissues to update RHO
:def scaling_relation_density(
prior_model: sn.UnstructuredMesh,
proposed_model: sn.UnstructuredMesh,
) -> sn.UnstructuredMesh:
# Here we directly apply a scaling relation to the density model.
# We don't need the prior model in this case.
new_model = proposed_model.copy()
new_model.elemental_fields["RHO"] = (
0.893 * new_model.elemental_fields["VP"] - 349.0
)
return new_model
p += sn.InverseProblemConfiguration(
name="my_fourth_inversion",
prior_model="initial_model",
events=p.events.list(),
mapping=sn.Mapping(
scaling="absolute",
inversion_parameters=[
"VP",
],
postprocess_model_update=scaling_relation_density,
),
preconditioner=sn.ConstantSmoothing({"VP": 0.01}),
method=sn.TrustRegion(initial_trust_region_linf=10.0),
misfit_configuration="L2",
wavefield_compression=sn.WavefieldCompression(
forward_wavefield_sampling_interval=10
),
job_submission=sn.SiteConfig(
site_name=SALVUS_FLOW_SITE_NAME, ranks_per_job=4
),
)
# Will be removed for the website.
p.inversions.set_stopping_criteria(
inverse_problem_configuration="my_fourth_inversion",
criteria={"max_iterations_global": 2},
)
p.inversions.iterate(
"my_fourth_inversion",
timeout_in_seconds=360,
delete_disposable_files="all",
)
p.viz.nb.inversion(inverse_problem_configuration="my_fourth_inversion")
[2025-01-09 22:08:19,985] INFO: Adding new iteration #0. [2025-01-09 22:08:19,994] INFO: Resuming iteration #0. [2025-01-09 22:08:20,000] INFO: 1 new tasks have been issued. [2025-01-09 22:08:20,000] INFO: Processing task `misfit_and_gradient` [2025-01-09 22:08:20,562] INFO: Iteration 0: Number of events: 5 chi = 0.018681064754203797 ||g|| = 0.02159122070536007 pred = --- ared = --- norm_update = --- tr_radius = --- [2025-01-09 22:08:20,563] INFO: 1 new tasks have been issued. [2025-01-09 22:08:20,563] INFO: Processing task `preconditioner` [2025-01-09 22:08:20,628] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:20,642] INFO: Processing task `preconditioner` [2025-01-09 22:08:20,691] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:20,708] INFO: Processing task `preconditioner` [2025-01-09 22:08:20,745] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:20,757] INFO: Processing task `preconditioner` [2025-01-09 22:08:20,793] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:20,805] INFO: Processing task `preconditioner` [2025-01-09 22:08:20,838] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:20,850] INFO: Processing task `preconditioner` [2025-01-09 22:08:20,882] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:20,895] INFO: Processing task `preconditioner` [2025-01-09 22:08:20,932] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:20,949] INFO: Processing task `preconditioner` [2025-01-09 22:08:20,992] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,004] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,046] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,058] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,105] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,123] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,165] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,182] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,222] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,241] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,292] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,313] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,362] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,378] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,425] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,441] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,489] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,504] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,543] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,555] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,601] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,622] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,671] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,688] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,738] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,752] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,799] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,816] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,868] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:21,885] INFO: Processing task `preconditioner` [2025-01-09 22:08:21,976] INFO: 1 new tasks have been issued. [2025-01-09 22:08:21,977] INFO: Processing task `misfit` [2025-01-09 22:08:22,024] INFO: Submitting job array with 5 jobs ... [2025-01-09 22:08:22,124] INFO: Launched simulations for 5 events. Please check again to see if they are finished. [2025-01-09 22:08:22,125] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,150] INFO: Processing task `misfit` [2025-01-09 22:08:22,208] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,241] INFO: Processing task `misfit` [2025-01-09 22:08:22,305] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,338] INFO: Processing task `misfit` [2025-01-09 22:08:22,403] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,436] INFO: Processing task `misfit` [2025-01-09 22:08:22,500] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,533] INFO: Processing task `misfit` [2025-01-09 22:08:22,591] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,623] INFO: Processing task `misfit` [2025-01-09 22:08:22,688] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,722] INFO: Processing task `misfit` [2025-01-09 22:08:22,788] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,811] INFO: Processing task `misfit` [2025-01-09 22:08:22,871] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,896] INFO: Processing task `misfit` [2025-01-09 22:08:22,947] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:22,978] INFO: Processing task `misfit` [2025-01-09 22:08:23,037] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:23,062] INFO: Processing task `misfit` [2025-01-09 22:08:23,339] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:23,361] INFO: Processing task `misfit` [2025-01-09 22:08:23,420] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:23,442] INFO: Processing task `misfit` [2025-01-09 22:08:23,502] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:23,531] INFO: Processing task `misfit` [2025-01-09 22:08:23,592] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:23,622] INFO: Processing task `misfit` [2025-01-09 22:08:23,689] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2025-01-09 22:08:23,718] INFO: Processing task `misfit` [2025-01-09 22:08:23,789] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:23,821] INFO: Processing task `misfit` [2025-01-09 22:08:23,883] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:23,912] INFO: Processing task `misfit` [2025-01-09 22:08:23,974] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:24,004] INFO: Processing task `misfit` [2025-01-09 22:08:24,066] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:24,096] INFO: Processing task `misfit` [2025-01-09 22:08:24,157] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:24,187] INFO: Processing task `misfit` [2025-01-09 22:08:24,248] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:24,277] INFO: Processing task `misfit` [2025-01-09 22:08:24,337] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:24,364] INFO: Processing task `misfit` [2025-01-09 22:08:24,714] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:24,745] INFO: Processing task `misfit` [2025-01-09 22:08:24,810] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:24,841] INFO: Processing task `misfit` [2025-01-09 22:08:24,906] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:24,941] INFO: Processing task `misfit` [2025-01-09 22:08:25,007] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,039] INFO: Processing task `misfit` [2025-01-09 22:08:25,100] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,133] INFO: Processing task `misfit` [2025-01-09 22:08:25,199] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,232] INFO: Processing task `misfit` [2025-01-09 22:08:25,297] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,330] INFO: Processing task `misfit` [2025-01-09 22:08:25,396] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,429] INFO: Processing task `misfit` [2025-01-09 22:08:25,496] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,530] INFO: Processing task `misfit` [2025-01-09 22:08:25,597] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,631] INFO: Processing task `misfit` [2025-01-09 22:08:25,697] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,732] INFO: Processing task `misfit` [2025-01-09 22:08:25,796] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,825] INFO: Processing task `misfit` [2025-01-09 22:08:25,882] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:25,912] INFO: Processing task `misfit` [2025-01-09 22:08:26,234] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,263] INFO: Processing task `misfit` [2025-01-09 22:08:26,326] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,358] INFO: Processing task `misfit` [2025-01-09 22:08:26,419] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,448] INFO: Processing task `misfit` [2025-01-09 22:08:26,510] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,536] INFO: Processing task `misfit` [2025-01-09 22:08:26,590] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,624] INFO: Processing task `misfit` [2025-01-09 22:08:26,690] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,717] INFO: Processing task `misfit` [2025-01-09 22:08:26,776] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,805] INFO: Processing task `misfit` [2025-01-09 22:08:26,850] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,874] INFO: Processing task `misfit` [2025-01-09 22:08:26,919] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:26,941] INFO: Processing task `misfit` [2025-01-09 22:08:26,991] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,015] INFO: Processing task `misfit` [2025-01-09 22:08:27,060] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,081] INFO: Processing task `misfit` [2025-01-09 22:08:27,131] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,152] INFO: Processing task `misfit` [2025-01-09 22:08:27,201] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,222] INFO: Processing task `misfit` [2025-01-09 22:08:27,497] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,532] INFO: Processing task `misfit` [2025-01-09 22:08:27,595] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,630] INFO: Processing task `misfit` [2025-01-09 22:08:27,701] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,733] INFO: Processing task `misfit` [2025-01-09 22:08:27,803] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,835] INFO: Processing task `misfit` [2025-01-09 22:08:27,910] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:27,950] INFO: Processing task `misfit` [2025-01-09 22:08:28,006] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:28,032] INFO: Processing task `misfit` [2025-01-09 22:08:28,095] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:28,128] INFO: Processing task `misfit` [2025-01-09 22:08:28,190] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:28,222] INFO: Processing task `misfit` [2025-01-09 22:08:28,284] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:28,317] INFO: Processing task `misfit` [2025-01-09 22:08:28,379] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:28,409] INFO: Processing task `misfit` [2025-01-09 22:08:28,478] INFO: Some tasks of iteration #0 are still running. Please check again later.
[2025-01-09 22:08:28,509] INFO: Processing task `misfit` [2025-01-09 22:08:28,561] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:28,586] INFO: Processing task `misfit` [2025-01-09 22:08:28,642] INFO: Some tasks of iteration #0 are still running. Please check again later. [2025-01-09 22:08:28,664] INFO: Processing task `misfit` [2025-01-09 22:08:30,599] INFO: old misfit control group: 0.018681064754203797 new misfit control group: 0.007324120186341101 predicted reduction control group: -0.009520467601654339 actual reduction control group: -0.011356944567862695 5 out of 5 event(s) improved the misfit. [2025-01-09 22:08:30,599] INFO: Model update accepted. [2025-01-09 22:08:30,600] INFO: 1 new tasks have been issued. [2025-01-09 22:08:30,600] INFO: Processing task `finalize_iteration` [2025-01-09 22:08:30,666] INFO: ... searching for obsolete files in project/INVERSIONS/my_fourth_inversion/00000 [2025-01-09 22:08:30,682] INFO: Freed up 1.1 MB of space. [2025-01-09 22:08:30,683] INFO: Succesfully completed iteration #0. [2025-01-09 22:08:30,685] INFO: Adding new iteration #1.
p.simulations.get_mesh(
p.inversions.get_simulation_name(
inverse_problem_configuration="my_fourth_inversion", iteration_id=1
)
)
<salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh object at 0x7d1da8eb5350>