# Inversion -- Q&A

**URL:** <https://simpeg.discourse.group/t/inversion-q-a/230>\
**Category:** Getting Started\
**Created:** [June 10, 2021, 7:42am UTC](https://simpeg.discourse.group/t/inversion-q-a/230 "2021-06-10T07:42:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![prisae](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/prisae/32/117_2.png) [@prisae](https://simpeg.discourse.group/u/prisae)\
**Post date:** [June 10, 2021, 7:42am UTC](https://simpeg.discourse.group/t/inversion-q-a/230/1 "2021-06-10T07:42:55Z")

</div>

(As discussed in Slack and at the weekly meeting.)

The documentation of the inversion implemented in SimPEG is… sparse.

As such we agreed to have a (recorded) session with the Core Devs of the inversion framework, where they will show how the SimPEG inversion works, followed by a Q&A Session. And potentially with a brainstorming of the path forward for the inversion part.

This thread is to collect questions users have around the inversion part of SimPEG, so that the core devs and prepare accordingly a session.

---

<div class="post-metadata">

**Author:** ![prisae](https://yyz2.discourse-cdn.com/free1/user_avatar/simpeg.discourse.group/prisae/32/117_2.png) [@prisae](https://simpeg.discourse.group/u/prisae)\
**Post date:** [June 10, 2021, 7:49am UTC](https://simpeg.discourse.group/t/inversion-q-a/230/2 "2021-06-10T07:49:06Z")

</div>

This is the question with which it started:

- How does the inversion decides, when to _skip BFGS_ ?

Others for me are

- Generally what algorithm is implemented, how does it work?
- What happens within 1 SimPEG iteration

Things to brainstorm

- Maybe improve the verbosity (what is printed)
- Add a timer? (I don’t think it currently shows how long it took, right?)
- Easy functionalities to store and load inversion results (xx)
- Easy functionality to restart an inversion after some iterations (xx)

(xx): if it exists, document.

---

<div class="post-metadata">

**Author:** ![craigm1](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@craigm1](https://simpeg.discourse.group/u/craigm1)\
**Post date:** [June 10, 2021, 9:56am UTC](https://simpeg.discourse.group/t/inversion-q-a/230/3 "2021-06-10T09:56:56Z")

</div>

What do all the columns of numbers in the inversion output mean?

```auto
=============================== Projected GNCG ===============================                                                 
# beta phi_d phi_m f |proj(x-g)-x| LS Comment               
------------------------------------------------------------------------------                            
x0 has any nan: 0
   0 1.85e+08 1.51e+05 4.82e-07 1.51e+05 4.14e+01 0
   1 9.25e+07 1.17e+05 7.42e-05 1.24e+05 4.37e+01 0
   2 4.63e+07 8.95e+04 2.75e-04 1.02e+05 4.40e+01 0 Skip BFGS

```

It would be useful to go through how these change during the inversion and how you know when it is working properly. i.e `beta` should decrease, `phi_d` should decrease,` phi_m` should increase etc etc. `F = phi_d + beta * phi_m`, what is the `|proj (x-g)|` value, `LS`? Should I be worried if i’m skipping BFGS…

What parameters can I tune within the inversion to speed up convergence, `f_min_change` etc?  
How should I set my initial beta?  
What happens when the “line search failed…” and how can I prevent that.

likewise the numbers at the end of the inversion. what do they mean?

```auto
  15 2.26e+04 4.15e+02 1.40e-02 7.31e+02 3.99e+01 0 Minimum decrease in regularization.End of IRLS     
     ------------------------- STOP! ------------------------- 
1 : |fc-fOld| = 0.0000e+00 <= tolF*(1+|f0|) = 1.5118e+04
1 : |xc-x_last| = 1.6353e-07 <= tolX*(1+|x0|) = 1.0667e-01   
0 : |proj(x-g)-x| = 3.9937e+01 <= tolG = 1.0000e-01
0 : |proj(x-g)-x| = 3.9937e+01 <= 1e3*eps = 1.0000e-02       
0 : maxIter = 50 <= iter = 16   
    ------------------------- DONE! ------------------------- 
 Target Misfit: 5.195e+02 (1039 data with chifact = 1) 
  Final Misfit: 4.147e+02  

```

---

<div class="post-metadata">

**Author:** ![craigm1](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@craigm1](https://simpeg.discourse.group/u/craigm1)\
**Post date:** [June 10, 2021, 9:58am UTC](https://simpeg.discourse.group/t/inversion-q-a/230/4 "2021-06-10T09:58:41Z")

</div>

often i’d like to reload an L2 starting model and kick straight into a range of Lp norms without having to run L2 everytime.

---

<div class="post-metadata">

**Author:** ![RichardScottOZ](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@RichardScottOZ](https://simpeg.discourse.group/u/RichardScottOZ)\
**Post date:** [June 10, 2021, 11:10am UTC](https://simpeg.discourse.group/t/inversion-q-a/230/5 "2021-06-10T11:10:18Z")

</div>

Yes, could have layperson verbosity to go with the equation level here

---

<div class="post-metadata">

**Author:** ![RichardScottOZ](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@RichardScottOZ](https://simpeg.discourse.group/u/RichardScottOZ)\
**Post date:** [June 10, 2021, 11:32am UTC](https://simpeg.discourse.group/t/inversion-q-a/230/6 "2021-06-10T11:32:17Z")

</div>

Which directive can take path, filename etc adjustments and when will they work?

---

<div class="post-metadata">

**Author:** ![swalker](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@swalker](https://simpeg.discourse.group/u/swalker)\
**Post date:** [June 10, 2021, 11:57am UTC](https://simpeg.discourse.group/t/inversion-q-a/230/7 "2021-06-10T11:57:38Z")

</div>

I would echo all the questions Craig wrote. In addition to understanding the outputs I would really like to see a step by step of what happens during an inversion. Inside the code it is a loop with something that happen in the first iteration only, at the start of an iteration, middle of the iteration and at the end of an iteration and then a final step after reaching some stopping criteria. What exactly takes places and then how the users’ choices affect what is happening and when. Directives will have the most obvious effect but do other things like choice of regularization change. Back in January on Slack I brought up the point that objective function values reported on screen at each iteration were different than those stored for use later (it was mainly the model norm I think). The consensus was that the values were written/stored at different points in the iteration and this accounted for the discrepancy. while this made sense as an explanation it adds to the opacity for a user. It would be good to have some of these things explained.

---

<div class="post-metadata">

**Author:** ![micmitch](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@micmitch](https://simpeg.discourse.group/u/micmitch)\
**Post date:** [June 14, 2021, 10:16pm UTC](https://simpeg.discourse.group/t/inversion-q-a/230/8 "2021-06-14T22:16:08Z")

</div>

A more detailed description of what’s going on in the sparse regularization update\_IRLS directive and what the tolerance parameters are controlling would be helpful. How is the beta cooling schedule and target misfit effected by the use of this directive?

---

<div class="post-metadata">

**Author:** ![Josare](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@Josare](https://simpeg.discourse.group/u/Josare)\
**Post date:** [July 14, 2021, 5:03am UTC](https://simpeg.discourse.group/t/inversion-q-a/230/9 "2021-07-14T05:03:38Z")

</div>

Hello, I have a question about the mathematical approach to MT inversion, I am trying to do a multi-objective inversion with 2 different models, I have my 2 separate objective functions, then for those 2 functions I have to do? is that I am entering the code but everything is resolved but I want to put it all mathematically, thank you very much for your attention.

---

<div class="post-metadata">

**Author:** ![Hui](https://avatars.discourse-cdn.com/v4/letter/h/a4c791/32.png) [@Hui](https://simpeg.discourse.group/u/Hui)\
**Post date:** [September 7, 2022, 6:48pm UTC](https://simpeg.discourse.group/t/inversion-q-a/230/10 "2022-09-07T18:48:28Z")

</div>

Hi,have you solved these problems? I also want to know what these column headings mean, and what does the following inversion stopping criterion mean? Can you help me?
