I tried run inversion with this setting but the proj did not decrease, increase. In the example in documentation, I can see that proj decreases with each iteration. So, what do i do in this case?
# set up the data misfit
dmisfit = data_misfit.L2DataMisfit(data=dc_data, simulation=simulation_dc)
# Related to inversion
reg = regularization.WeightedLeastSquares(
mesh,
alpha_s=1./mesh.h[0].min()**2,
alpha_x=1,
alpha_y=1#./mesh.h[0].min()**2, # since this is a 2D problem, the second dimension is "y"
)
opt = optimization.InexactGaussNewton(maxIter=20, maxIterCG=15)
# opt = optimization.SteepestDescent(maxIter=15)
# opt = optimization.GaussNewton(maxIter=15, maxIterCG=15)
inv_prob = inverse_problem.BaseInvProblem(dmisfit, reg, opt)
# directives
save = directives.SaveOutputDictEveryIteration()
beta_est = directives.BetaEstimate_ByEig(beta0_ratio=1e3)
beta_schedule = directives.BetaSchedule(coolingFactor=8, coolingRate=1.5)
target = directives.TargetMisfit()
inv = inversion.BaseInversion(
inv_prob, directiveList=[beta_est, beta_schedule, target, save]
)
# Run inversion
mopt = inv.run(m0)
SimPEG.InvProblem will set Regularization.reference_model to m0.
SimPEG.InvProblem will set Regularization.reference_model to m0.
SimPEG.InvProblem will set Regularization.reference_model to m0.
SimPEG.InvProblem will set Regularization.reference_model to m0.
SimPEG.InvProblem will set Regularization.reference_model to m0.
SimPEG.InvProblem is setting bfgsH0 to the inverse of the eval2Deriv.
***Done using same Solver, and solver_opts as the Simulation2DNodal problem***
model has any nan: 0
============================ Inexact Gauss Newton ============================
# beta phi_d phi_m f |proj(x-g)-x| LS Comment
-----------------------------------------------------------------------------
x0 has any nan: 0
0 4.04e-04 2.71e+03 0.00e+00 2.71e+03 1.41e-01 0
1 5.05e-05 2.69e+03 6.08e+02 2.69e+03 5.81e+00 3
2 6.31e-06 2.61e+03 1.95e+03 2.61e+03 8.25e+00 5
3 7.88e-07 2.59e+03 1.87e+03 2.59e+03 1.90e+01 4
4 9.85e-08 2.56e+03 2.53e+03 2.56e+03 2.06e+01 4
5 1.23e-08 2.51e+03 5.07e+03 2.51e+03 3.95e+01 3
6 1.54e-09 2.35e+03 5.31e+03 2.35e+03 5.31e+01 4 Skip BFGS
7 1.92e-10 2.08e+03 6.55e+03 2.08e+03 8.83e+01 3
8 2.41e-11 1.75e+03 8.44e+03 1.75e+03 2.78e+02 1
9 3.01e-12 1.56e+03 9.00e+03 1.56e+03 1.02e+02 0
10 3.76e-13 1.52e+03 1.25e+04 1.52e+03 1.05e+02 1
11 4.70e-14 1.42e+03 1.30e+04 1.42e+03 1.12e+02 3
12 5.87e-15 1.34e+03 1.33e+04 1.34e+03 1.89e+02 4
13 7.34e-16 1.29e+03 1.21e+04 1.29e+03 2.02e+02 0
14 9.18e-17 1.05e+03 2.09e+04 1.05e+03 2.07e+02 1
15 1.15e-17 1.02e+03 2.52e+04 1.02e+03 2.57e+02 1
16 1.43e-18 8.79e+02 2.36e+04 8.79e+02 1.29e+02 1
17 1.79e-19 8.64e+02 2.47e+04 8.64e+02 2.48e+02 0
18 2.24e-20 8.55e+02 2.56e+04 8.55e+02 2.51e+02 0
19 2.80e-21 8.05e+02 2.50e+04 8.05e+02 4.05e+01 0
20 3.50e-22 8.04e+02 2.65e+04 8.04e+02 8.50e+01 0 Skip BFGS
------------------------- STOP! -------------------------
1 : |fc-fOld| = 1.6287e+00 <= tolF*(1+|f0|) = 2.7157e+02
1 : |xc-x_last| = 6.2543e+00 <= tolX*(1+|x0|) = 2.6258e+01
0 : |proj(x-g)-x| = 8.5027e+01 <= tolG = 1.0000e-01
0 : |proj(x-g)-x| = 8.5027e+01 <= 1e3*eps = 1.0000e-02
1 : maxIter = 20 <= iter = 20
------------------------- DONE! -------------------------