-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unimplemented function in regulariser plugins are opaque #755
Comments
Thanks @ashgillman, I'm generally inclined to raise an error rather than returning |
An error makes the most sense if calling these is dangerous (i.e., if it turns out that these may be causing some errors I am seeing in other discussions). I'm not quite familiar enough with the optimisers to know whether in some cases, ignoring these operators is semi-valid (I assumed that might be the case and why |
Somewhat related, I don't think |
I believe that the regularisers are meant to be used in our optimisation framework only with their For |
Any regulariser exposed by the plugin should have a correct __call__ method
provided by the plugin, so that for example objective function value is
reported correctly in optimisation algorithms. If that is not the case, it
must be fixed.
…On Wed, 10 Feb 2021, 15:19 Edoardo Pasca, ***@***.***> wrote:
I believe that the regularisers are meant to be used in our optimisation
framework *only* with their proximal method, which in itself is a
minimisation problem. That is the reason why they are functions where only
proximal is developed.
For TV and dTV that expression of __call__ might be correct but it's
better to ask a mathematician, @jakobsj <https://github.com/jakobsj>
@epapoutsellis <https://github.com/epapoutsellis> .
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/vais-ral/CCPi-Framework/issues/755#issuecomment-776736417>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMDSCF7YEL6OYKNOU4UIK3S6KIWXANCNFSM4XIVCUUQ>
.
|
From @epapoutsellis
To start with I suggest we remove the definition (override) in the derived class. If no implementation is given the base class method will be called, which already raises Currently, dTV implementation will be implemented in TomographicImaging/CCPi-Regularisation-Toolkit#159 |
If we use |
You could also throw an error, and then catch it at a known place where it is called but the value isn't necessary |
I believe at this point a value needs to be returned for the algorithms to run as mentioned by @epapoutsellis. For a quick-fix I think that returning nan as suggested by @ashgillman is safer than 0, and is the best option at this point, since it clearly indicates that something is not right, but does allow the algorithm to run. Probably with a warning, but a warning may easily be overlooked which is why returning 0 is dangerous. |
Agreement is:
|
Fixed in current version |
There are a number of unimplemented functions in regularisers.py. The following in non-exhaustive.
These have comments:
https://github.com/vais-ral/CCPi-Framework/blob/1803cbd445c408588fecbf705fb8b4df486029fc/Wrappers/Python/cil/plugins/ccpi_regularisation/functions/regularisers.py#L164-L166
https://github.com/vais-ral/CCPi-Framework/blob/1803cbd445c408588fecbf705fb8b4df486029fc/Wrappers/Python/cil/plugins/ccpi_regularisation/functions/regularisers.py#L261-L263
This one prints a warning:
https://github.com/vais-ral/CCPi-Framework/blob/1803cbd445c408588fecbf705fb8b4df486029fc/Wrappers/Python/cil/plugins/ccpi_regularisation/functions/regularisers.py#L184-L188
This one is unmarked:
https://github.com/vais-ral/CCPi-Framework/blob/1803cbd445c408588fecbf705fb8b4df486029fc/Wrappers/Python/cil/plugins/ccpi_regularisation/functions/regularisers.py#L109-L110
They all return 0.
It is understandable for them to be unimplemented, but it would be nice for it to be a little more transparent to the user. Would it make sense to (a) give them all a warning message, and (b) have them return NaN so that the code can run on, but that the results will clearly be invalid when the user attempts to plot them?
The text was updated successfully, but these errors were encountered: