question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SaveOutputEveryIteration Directive errors

See original GitHub issue

Can no longer use the SaveOutputEveryIteration directive on the the dcip/dev branch. I get the following error when calling this function using Tikhonov regularization on a treemesh.

SimPEG.InvProblem is setting bfgsH0 to the inverse of the eval2Deriv.
    ***Done using same Solver and solverOpts as the problem***
Use Tikhonov
SimPEG.SaveOutputEveryIteration will save your inversion progress as: '###-InversionModel-2017-12-20-12-06.txt'
SimPEG.SaveModelEveryIteration will save your models as: '###-InversionModel-2017-12-20-12-06.npy'
model has any nan: 0
============================ Inexact Gauss Newton ============================
  #     beta     phi_d     phi_m       f      |proj(x-g)-x|  LS    Comment   
-----------------------------------------------------------------------------
x0 has any nan: 0
   0  1.22e-01  1.64e+05  7.60e+01  1.64e+05    2.35e+05      0              
Traceback (most recent call last):
  File "InvScript.py", line 225, in <module>
    mopt = inv.run(m0)
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Utils/CounterUtils.py", line 99, in wrapper
    out = f(self, *args, **kwargs)
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Inversion.py", line 67, in run
    self.m = self.opt.minimize(self.invProb.evalFunction, self.invProb.model)
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Utils/CounterUtils.py", line 99, in wrapper
    out = f(self, *args, **kwargs)
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Optimization.py", line 291, in minimize
    self.doEndIteration(xt)
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Utils/CounterUtils.py", line 88, in wrapper
    out = f(self, *args, **kwargs)
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Utils/codeutils.py", line 144, in wrapper
    return f(self,*args,**kwargs)
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Optimization.py", line 564, in doEndIteration
    self.callback(xt)
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Inversion.py", line 73, in _optCallback
    self.directiveList.call('endIter')
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Directives.py", line 170, in call
    getattr(r, ruleType)()
  File "/tera_raid/mmitchel/Programs/simpeg/SimPEG/Directives.py", line 351, in endIter
    self.reg.objfcts[0](self.invProb.model) * self.reg.alpha_s
AttributeError: 'ComboObjectiveFunction' object has no attribute 'alpha_s'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
thastcommented, Dec 28, 2017

@fourndo: I understand we want to be able to handle several regularizers (that can be so powerful!). What I am less sure about, and not a big fan so far, is the discrepancy between the type of object when calling *.reg.

Moreover, This also create inconsistency of interaction (as reported by @micmitch ) and naming convention. For example there is also now an inconsistency for the use of the term objfcts: in one case sel.reg.objfcts is a full regularization (Simple or Tikhnov object) while in the case self.invProb.reg.objfcts it calls the individual norms or portions ( Small or SmoothDeriv …) . It seems we now define objfcts as a handle to always access the next subdivision, but I am not sure of the name anymore in this case.

So with my current understanding, Would not it be better then to also turn invProb.reg into a ComboObjectiveFunction object then to ensure consistency when calling a reg object?

0reactions
jcapriotcommented, Oct 28, 2022

I believe the underlying bug here was fixed a while ago, as this is working in the more recent versions. However the discussion on how directives being tied to specific regularizations is still relevant.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Troubleshoot Angular "10 $digest() iterations reached ...
You're going to get this error message because Angular tries to have the "stability" and will execute the function until it returns the...
Read more >
for:each template directives in LWC - Salesforce Blog - SfdcPoint
Click Save and activate. We will have the following output: for each template directives in LWC. iterator ...
Read more >
Template::Manual::Directives
The FOREACH directive will iterate through the items in a list, processing the enclosed block for each one. [% foo = 'Foo' items...
Read more >
27.4. Format Directive Interface
An arg, any Lisp object, is printed obeying every printer control variable ... ~I, and ~:T. As a result, an error is signaled...
Read more >
4. Template Directives - Perl Template Toolkit [Book] - O'Reilly
With all of these directives, the results of processing the template are included in the output in place of the directive. The WRAPPER...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found