Possibly deal with a good chunk of the old_divs

This commit is contained in:
Brendan Smithyman
2016-07-17 16:02:43 -05:00
parent 7189ec5b2f
commit f7a70aa6a7
85 changed files with 369 additions and 454 deletions
+5 -6
View File
@@ -6,7 +6,6 @@ from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import range
from past.utils import old_div
from SimPEG import *
@@ -56,10 +55,10 @@ def run(N=100, plotIt=True):
# Distance weighting
wr = np.sum(prob.G**2.,axis=0)**0.5
wr = ( old_div(wr,np.max(wr)) )
wr = ( wr/np.max(wr))
dmis = DataMisfit.l2_DataMisfit(survey)
dmis.Wd = old_div(1.,wd)
dmis.Wd = 1./wd
betaest = Directives.BetaEstimate_ByEig()
@@ -68,15 +67,15 @@ def run(N=100, plotIt=True):
reg.cell_weights = wr
reg.mref = np.zeros(mesh.nC)
opt = Optimization.ProjectedGNCG(maxIter=100 ,lower=-2.,upper=2., maxIterLS = 20, maxIterCG= 10, tolCG = 1e-3)
invProb = InvProblem.BaseInvProblem(dmis, reg, opt)
update_Jacobi = Directives.Update_lin_PreCond()
# Set the IRLS directive, penalize the lowest 25 percentile of model values
# Start with an l2-l2, then switch to lp-norms
norms = [0., 0., 2., 2.]
norms = [0., 0., 2., 2.]
IRLS = Directives.Update_IRLS( norms=norms, prctile = 25, maxIRLSiter = 15, minGNiter=3)
inv = Inversion.BaseInversion(invProb, directiveList=[IRLS,betaest,update_Jacobi])