upper=10, maxIterLS=20, maxIterCG=30, tolCG=1e-4) #opt = Optimization.InexactGaussNewton(maxIter = 20) invProb = InvProblem.BaseInvProblem(dmisfit, reg, opt, beta=beta) # Create an inversion object beta = Directives.BetaSchedule(coolingFactor=2, coolingRate=2) betaest = Directives.BetaEstimate_ByEig(beta0_ratio=1e0) # save = Directives.SaveOutputEveryIteration() target = Directives.TargetMisfit() update_IRLS = Directives.Update_IRLS(f_min_change=1e-3, minGNiter=2, maxIRLSiter=10) updateWr = Directives.UpdateSensWeighting() inv = Inversion.BaseInversion(invProb, directiveList=[update_IRLS, updateWr]) problem.counter = opt.counter = Utils.Counter() opt.LSshorten = 0.5 opt.remember('xc') mopt = inv.run(m0) # #%% Plot the model if changeMref: figName = 'DC_PDP_' + wrType + '_' + str(mref_val) + 'RefUpdate.png' else: figName = 'DC_PDP_' + wrType + '_' + str(mref_val) + 'Ref.png' mout = np.log10(mapping * mopt)
lower=Lbound, upper=Ubound, maxIterLS=10, maxIterCG=20, tolCG=1e-3, LSalwaysPass=True, stepOffBoundsFact=1e-8) invProb = InvProblem.BaseInvProblem(dmis, reg, opt) # LIST OF DIRECTIVES # betaest = Directives.BetaEstimate_ByEig() IRLS = Directives.Update_IRLS(f_min_change=1e-6, minGNiter=2, beta_tol=1e-2, coolingRate=2) update_SensWeight = Directives.UpdateSensWeighting() update_Jacobi = Directives.UpdatePreCond() ProjSpherical = Directives.ProjSpherical() JointAmpMVI = Directives.JointAmpMVI() betaest = Directives.BetaEstimate_ByEig(beta0_ratio = 1e+3) saveModel = Directives.SaveUBCModelEveryIteration(mapping=actvMap, saveComp=True) saveModel.fileName = work_dir+out_dir + 'JOINT_MVIC_A' inv = Inversion.BaseInversion(invProb, directiveList=[betaest, IRLS, update_SensWeight, update_Jacobi, saveModel]) # Run JOINT mrec = inv.run(mstart)
invProb = InvProblem.BaseInvProblem(dmis, reg, opt) # Here is the list of directives betaest = Directives.BetaEstimate_ByEig() # Specify the sparse norms IRLS = Directives.Update_IRLS(f_min_change=1e-3, minGNiter=3, coolingRate=1, chifact_target=0.25, maxIRLSiter=3) # Special directive specific to the mag amplitude problem. The sensitivity # weights are update between each iteration. update_SensWeight = Directives.UpdateSensWeighting(everyIter=True) update_Jacobi = Directives.UpdatePreCond(epsilon=1e-3) saveModel = Directives.SaveUBCModelEveryIteration(mapping=actvMap) saveModel.fileName = work_dir + out_dir + 'AmpInv' # Put all together inv = Inversion.BaseInversion( invProb, directiveList=[betaest, IRLS, update_SensWeight, update_Jacobi, saveModel]) # Invert mrec = inv.run(mstart) # Outputs Mesh.TensorMesh.writeModelUBC(mesh, work_dir + out_dir + "AmpInv_l2l2.sus",