-
Notifications
You must be signed in to change notification settings - Fork 105
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
Implement complex -> real functionals (e.g. L2Norm) #1328
Comments
Hi @miallo! You are bumping into an age-old discussion/issue, namely #590. Yes, a norm should map to the real numbers. However, the definition of a functional that we have used (at least so far) in Also: great that you like |
Thank you! I see... I must have been stuck in the "historical" point of view... 😁 Can you give me a hint then on how to extract the real part out of the ComplexNumbers()? Since I use the operator I cant just type Now the stupid physicist inside of me asks: Would something break if you set the range of a Functional by default to |
Hey @miallo, many thanks for your feedback! Adding to @aringh's comments, our support for complex functionals isn't terribly well-established. However, most of the issues have to do with complex-valued functionals, where it's not obvious how to define convex conjugate, proximal etc. There are also some related issues with real<->complex mappings, some of which are discussed in #1317 and #1324. The approach there is basically what you suggest (so it's not stupid at all), only for However in your case of complex->real functionals we might actually get around those issues for derived properties of such functionals. Let me try to think aloud:
The best way forward from my perspective would be to use And, of course, nice that you like ODL 😃 |
Thank you both for your help! It might take me some time to get this done properly, but at least now I know what to do 😃 |
Since this is a desirable change, I'll reopen this so we can track the underlying issue. If you want to make a PR, @miallo, we'd highly appreciate that. You can make it a WIP (work-in-progress) PR if you want some early feedback. |
(the example holds true for
L1Norm
andL2Norm
as well)2. And I have another problem: I want to create a functional that maps from the complex space to the real numbers (so I can minimise it). But the implementation of
odl.solvers.Functional
says that it maps tospace.field
(which for me would be the complex numbers). What can I do? Should I add an additional operator just to get the real part?3. And if so: when trying
odl.RealPart(l2NormSquared.range)
the result is'ComplexNumbers' object has no attribute 'real_space'
. For now I could live without the functional, but in the future I would want to optimise over a parameter in one of the operators.4. And even when I try to work around the functional I have problems:
throws an error since
f1
is of typeFunctionalComp
and'operators' must be a matrix of 'Operator' objects, '0' or 'None'
(<= by the way: shouldn't this rather read... must be an array/list of ...
?)5. But most importantly: Thank you for this nice module!
The text was updated successfully, but these errors were encountered: