chiSmall=0.5, # ask for twice as much clustering (target value is /2) ) # add learned mref in smooth once stable MrefInSmooth = directives.PGI_AddMrefInSmooth( wait_till_stable=True, verbose=True, ) # update the parameters in smallness (L2-approx of PGI) update_smallness = directives.PGI_UpdateParameters( update_gmm=True, # update the GMM each iteration kappa=np.c_[ # confidences in each mean phys. prop. of each cluster 1e10 * np.ones( 2 ), # fixed background at 0 density, 0 mag. susc. (high confidences of 1e10) [ 0, 1e10, ], # density-contrasting cluster: updatable density mean, fixed mag. susc. [ 1e10, 0, ], # magnetic-contrasting cluster: fixed density mean, updatable mag. susc. ].T, ) # pre-conditioner update_Jacobi = directives.UpdatePreconditioner() # iteratively balance the scaling of the data misfits scaling_init = directives.ScalingMultipleDataMisfits_ByEig( chi0_ratio=[1.0, 100.0]) scale_schedule = directives.JointScalingSchedule(verbose=True) # Create inverse problem
n_pw_iter=10) scaling_schedule = directives.JointScalingSchedule(verbose=True) alpha0_ratio = np.r_[np.zeros(len(reg_simple.objfcts[0].objfcts)), 100.0 * np.ones(len(reg_simple.objfcts[1].objfcts)), 1.0 * np.ones(len(reg_simple.objfcts[2].objfcts)), ] alphas = directives.AlphasSmoothEstimate_ByEig(alpha0_ratio=alpha0_ratio, n_pw_iter=10, verbose=True) beta = directives.BetaEstimate_ByEig(beta0_ratio=1e-5, n_pw_iter=10) betaIt = directives.PGI_BetaAlphaSchedule( verbose=True, coolingFactor=2.0, progress=0.2, ) targets = directives.MultiTargetMisfits(verbose=True) petrodir = directives.PGI_UpdateParameters(update_gmm=False) # Setup Inversion inv = inversion.BaseInversion( invProb, directiveList=[ alphas, scales, beta, petrodir, targets, betaIt, scaling_schedule ], ) mcluster_map = inv.run(minit) # Inversion with no nonlinear mapping reg_simple_no_map = utils.make_SimplePGI_regularization( mesh=mesh, gmmref=clfnomapping,
1e-4 * np.ones(len(reg.objfcts[1].objfcts)), 100.0 * 1e-4 * np.ones(len(reg.objfcts[2].objfcts)), ] Alphas = directives.AlphasSmoothEstimate_ByEig(alpha0_ratio=alpha0_ratio, verbose=True) # initialize beta and beta/alpha_s schedule beta = directives.BetaEstimate_ByEig(beta0_ratio=1e-2) betaIt = directives.PGI_BetaAlphaSchedule( verbose=True, coolingFactor=2.0, tolerance=0.2, progress=0.2, ) # geophy. and petro. target misfits targets = directives.MultiTargetMisfits(verbose=True,) # add learned mref in smooth once stable MrefInSmooth = directives.PGI_AddMrefInSmooth(wait_till_stable=True, verbose=True,) # update the parameters in smallness (L2-approx of PGI) update_smallness = directives.PGI_UpdateParameters( update_gmm=False # keep GMM model fixed ) # pre-conditioner update_Jacobi = directives.UpdatePreconditioner() # iteratively balance the scaling of the data misfits scaling_init = directives.ScalingMultipleDataMisfits_ByEig(chi0_ratio=[1.0, 100.0]) scale_schedule = directives.JointScalingSchedule(verbose=True) # Create inverse problem # Optimization # set lower and upper bounds lowerbound = np.r_[-2.0 * np.ones(actvMap.nP), 0.0 * np.ones(actvMap.nP)] upperbound = np.r_[0.0 * np.ones(actvMap.nP), 1e-1 * np.ones(actvMap.nP)] opt = optimization.ProjectedGNCG( maxIter=30, lower=lowerbound,
# Setup new inverse problem invProb = inverse_problem.BaseInvProblem(dmis, reg, opt) # directives Alphas = directives.AlphasSmoothEstimate_ByEig(alpha0_ratio=10.0, verbose=True) beta = directives.BetaEstimate_ByEig(beta0_ratio=1e-6) betaIt = directives.PGI_BetaAlphaSchedule( verbose=True, coolingFactor=2.0, warmingFactor=1.0, tolerance=0.1, update_rate=1, progress=0.2, ) targets = directives.MultiTargetMisfits(verbose=True) petrodir = directives.PGI_UpdateParameters() addmref = directives.PGI_AddMrefInSmooth(verbose=True) # Setup Inversion inv = inversion.BaseInversion( invProb, directiveList=[Alphas, beta, petrodir, targets, addmref, betaIt]) # Initial model same as for Tikhonov mcluster = inv.run(m0) # Final Plot fig, axes = plt.subplots(1, 3, figsize=(12 * 1.2, 4 * 1.2)) for i in range(prob.G.shape[0]): axes[0].plot(prob.G[i, :]) axes[0].set_title("Columns of matrix G")