mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-14 11:35:32 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33ea89702e | ||
|
|
b4ab60c260 |
@@ -272,6 +272,7 @@ class Update_IRLS(InversionDirective):
|
|||||||
self.reg.curModel = self.invProb.curModel
|
self.reg.curModel = self.invProb.curModel
|
||||||
self.reg.gamma = self.gamma
|
self.reg.gamma = self.gamma
|
||||||
|
|
||||||
|
self.reg._W = None
|
||||||
if getattr(self, 'phi_d_last', None) is None:
|
if getattr(self, 'phi_d_last', None) is None:
|
||||||
self.phi_d_last = self.invProb.phi_d
|
self.phi_d_last = self.invProb.phi_d
|
||||||
|
|
||||||
@@ -288,6 +289,7 @@ class Update_IRLS(InversionDirective):
|
|||||||
# Get phi_m at the end of current iteration
|
# Get phi_m at the end of current iteration
|
||||||
self.phi_m_last = self.invProb.phi_m_last
|
self.phi_m_last = self.invProb.phi_m_last
|
||||||
|
|
||||||
|
self.reg._W = None
|
||||||
# Update the model used for the IRLS weights
|
# Update the model used for the IRLS weights
|
||||||
self.reg.curModel = self.invProb.curModel
|
self.reg.curModel = self.invProb.curModel
|
||||||
|
|
||||||
|
|||||||
@@ -663,9 +663,8 @@ class Sparse(Simple):
|
|||||||
self.Rs = Utils.speye(self.regmesh.nC)
|
self.Rs = Utils.speye(self.regmesh.nC)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
f_m = self.curModel - self.reg.mref
|
f_m = self.mapping * (self.curModel - self.reg.mref)
|
||||||
self.rs = self.R(f_m , self.eps_p, self.norms[0])
|
self.rs = self.R(f_m , self.eps_p, self.norms[0])
|
||||||
#print "Min rs: " + str(np.max(self.rs)) + "Max rs: " + str(np.min(self.rs))
|
|
||||||
self.Rs = Utils.sdiag( self.rs )
|
self.Rs = Utils.sdiag( self.rs )
|
||||||
|
|
||||||
return Utils.sdiag((self.regmesh.vol*self.alpha_s*self.gamma*self.wght)**0.5)*self.Rs
|
return Utils.sdiag((self.regmesh.vol*self.alpha_s*self.gamma*self.wght)**0.5)*self.Rs
|
||||||
@@ -679,7 +678,7 @@ class Sparse(Simple):
|
|||||||
self.Rx = Utils.speye(self.regmesh.cellDiffxStencil.shape[0])
|
self.Rx = Utils.speye(self.regmesh.cellDiffxStencil.shape[0])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
f_m = self.regmesh.cellDiffxStencil * self.curModel
|
f_m = self.regmesh.cellDiffxStencil * (self.mapping * self.curModel)
|
||||||
self.rx = self.R( f_m , self.eps_q, self.norms[1])
|
self.rx = self.R( f_m , self.eps_q, self.norms[1])
|
||||||
self.Rx = Utils.sdiag( self.rx )
|
self.Rx = Utils.sdiag( self.rx )
|
||||||
|
|
||||||
@@ -693,7 +692,7 @@ class Sparse(Simple):
|
|||||||
self.Ry = Utils.speye(self.regmesh.cellDiffyStencil.shape[0])
|
self.Ry = Utils.speye(self.regmesh.cellDiffyStencil.shape[0])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
f_m = self.regmesh.cellDiffyStencil * self.curModel
|
f_m = self.regmesh.cellDiffyStencil * (self.mapping * self.curModel)
|
||||||
self.ry = self.R( f_m , self.eps_q, self.norms[2])
|
self.ry = self.R( f_m , self.eps_q, self.norms[2])
|
||||||
self.Ry = Utils.sdiag( self.ry )
|
self.Ry = Utils.sdiag( self.ry )
|
||||||
|
|
||||||
@@ -707,7 +706,7 @@ class Sparse(Simple):
|
|||||||
self.Rz = Utils.speye(self.regmesh.cellDiffzStencil.shape[0])
|
self.Rz = Utils.speye(self.regmesh.cellDiffzStencil.shape[0])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
f_m = self.regmesh.cellDiffzStencil * self.curModel
|
f_m = self.regmesh.cellDiffzStencil * (self.mapping * self.curModel)
|
||||||
self.rz = self.R( f_m , self.eps_q, self.norms[3])
|
self.rz = self.R( f_m , self.eps_q, self.norms[3])
|
||||||
self.Rz = Utils.sdiag( self.rz )
|
self.Rz = Utils.sdiag( self.rz )
|
||||||
|
|
||||||
@@ -729,6 +728,7 @@ class Sparse(Simple):
|
|||||||
def W(self):
|
def W(self):
|
||||||
"""Full regularization matrix W"""
|
"""Full regularization matrix W"""
|
||||||
if getattr(self, '_W', None) is None:
|
if getattr(self, '_W', None) is None:
|
||||||
|
|
||||||
wlist = (self.Wsmall, self.Wsmooth)
|
wlist = (self.Wsmall, self.Wsmooth)
|
||||||
self._W = sp.vstack(wlist)
|
self._W = sp.vstack(wlist)
|
||||||
return self._W
|
return self._W
|
||||||
|
|||||||
Reference in New Issue
Block a user