From 7964ebce50f86b87f11873cfb0e40632f4eb930f Mon Sep 17 00:00:00 2001 From: D Fournier Date: Tue, 10 May 2016 17:20:46 -0700 Subject: [PATCH] Update directive to None the Wsmooth after iteration. --- SimPEG/Directives.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SimPEG/Directives.py b/SimPEG/Directives.py index 4fc1ffc5..008cc57b 100644 --- a/SimPEG/Directives.py +++ b/SimPEG/Directives.py @@ -303,26 +303,27 @@ class Update_IRLS(InversionDirective): # Set the weighting matrix to None so that it is recomputed next time # it is called in the inversion self.reg._W = None + self.reg._Wsmooth = None class Update_lin_PreCond(InversionDirective): """ Create a Jacobi preconditioner for the linear problem """ onlyOnStart=False - + def initialize(self): - + if getattr(self.opt, 'approxHinv', None) is None: # Update the pre-conditioner diagA = np.sum(self.prob.G**2.,axis=0) + self.invProb.beta*(self.reg.W.T*self.reg.W).diagonal() #* (self.reg.mapping * np.ones(self.reg.curModel.size))**2. PC = Utils.sdiag((self.prob.mapping.deriv(None).T *diagA)**-1.) self.opt.approxHinv = PC - + def endIter(self): # Cool the threshold parameter if self.onlyOnStart==True: return - + if getattr(self.opt, 'approxHinv', None) is not None: # Update the pre-conditioner diagA = np.sum(self.prob.G**2.,axis=0) + self.invProb.beta*(self.reg.W.T*self.reg.W).diagonal() #* (self.reg.mapping * np.ones(self.reg.curModel.size))**2.