diff --git a/SimPEG/Directives.py b/SimPEG/Directives.py index a9b74276..6b15be9f 100644 --- a/SimPEG/Directives.py +++ b/SimPEG/Directives.py @@ -278,7 +278,6 @@ class Update_IRLS(InversionDirective): self.reg._Wx = None self.reg._Wy = None self.reg._Wz = None - self.reg._W = None if getattr(self, 'phi_d_last', None) is None: self.phi_d_last = self.invProb.phi_d @@ -308,20 +307,19 @@ class Update_IRLS(InversionDirective): self.reg._Wx = None self.reg._Wy = None self.reg._Wz = None - self.reg._W = None # Compute new model objective function value phim_new = self.reg.eval(self.invProb.curModel) # Update gamma to scale the regularization between IRLS iterations self.reg.gamma = self.phi_m_last / phim_new - + print "New gamma ", np.linalg.norm(self.reg.gamma) + # Reset the regularization matrices again for new gamma self.reg._Wsmall = None self.reg._Wx = None self.reg._Wy = None self.reg._Wz = None - self.reg._W = None class Update_lin_PreCond(InversionDirective): """ diff --git a/SimPEG/Regularization.py b/SimPEG/Regularization.py index 5dc5aba0..422c8f9c 100644 --- a/SimPEG/Regularization.py +++ b/SimPEG/Regularization.py @@ -451,32 +451,32 @@ class Simple(BaseRegularization): self._Wz = Utils.sdiag((self.alpha_z * (self.regmesh.aveCC2Fz*self.cell_weights))**0.5)*self.regmesh.cellDiffzStencil return self._Wz - @property - def Wsmooth(self): - """Full smoothness regularization matrix W""" - print 'wtf why are we using Wsmooth' - raise NotImplementedError - if getattr(self, '_Wsmooth', None) is None: - wlist = (self.Wx,) - if self.regmesh.dim > 1: - wlist += (self.Wy,) - if self.regmesh.dim > 2: - wlist += (self.Wz,) - self._Wsmooth = sp.vstack(wlist) - return self._Wsmooth - - @property - def W(self): - """Full regularization matrix W""" - print 'wtf why are we using W' - if getattr(self, '_W', None) is None: - wlist = (self.Wsmall, self.Wx) - if self.regmesh.dim > 1: - wlist += (self.Wy,) - if self.regmesh.dim > 2: - wlist += (self.Wz,) - self._W = sp.vstack(wlist) - return self._W +# @property +# def Wsmooth(self): +# """Full smoothness regularization matrix W""" +# print 'wtf why are we using Wsmooth' +# raise NotImplementedError +# if getattr(self, '_Wsmooth', None) is None: +# wlist = (self.Wx,) +# if self.regmesh.dim > 1: +# wlist += (self.Wy,) +# if self.regmesh.dim > 2: +# wlist += (self.Wz,) +# self._Wsmooth = sp.vstack(wlist) +# return self._Wsmooth +# +# @property +# def W(self): +# """Full regularization matrix W""" +# print 'wtf why are we using W' +# if getattr(self, '_W', None) is None: +# wlist = (self.Wsmall, self.Wx) +# if self.regmesh.dim > 1: +# wlist += (self.Wy,) +# if self.regmesh.dim > 2: +# wlist += (self.Wz,) +# self._W = sp.vstack(wlist) +# return self._W @Utils.timeIt