You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* AbsFunctions added
* Documentation
* set default precision to double, as necessary for SAR which is currently the only use case for FunctionOfAbs
returned type hints
* added output type hints
* convex_conjugate returns 0. when mathematically undefined to ensure compatibility with optimisation algorithms.
precision default set to double to ensure sufficient accuracy with e.g. SAR imaging
docstring updated to reflect these changes
* made decorators separate from class
* Get precision from inputted x
* Update NOTICE.txt
* Changelog
---------
Signed-off-by: Margaret Duff <[email protected]>
Signed-off-by: Hannah Robarts <[email protected]>
Co-authored-by: Margaret Duff <[email protected]>
Co-authored-by: Laura Murgatroyd <[email protected]>
Co-authored-by: hrobarts <[email protected]>
# This work has been supported by the Royal Academy of Engineering and the
20
+
# Office of the Chief Science Adviser for National Security under the UK
21
+
# Intelligence Community Postdoctoral Research Fellowship programme.
22
+
#
23
+
# Francis M Watson, University of Manchester 2024
24
+
#
25
+
26
+
27
+
importnumpyasnp
28
+
fromcil.optimisation.functionsimportFunction
29
+
fromcil.frameworkimportDataContainer
30
+
fromtypingimportOptional
31
+
importwarnings
32
+
importlogging
33
+
34
+
log=logging.getLogger(__name__)
35
+
36
+
classFunctionOfAbs(Function):
37
+
r'''A function which acts on the absolute value of the complex-valued input,
38
+
39
+
.. math:: G(z) = H(abs(z))
40
+
41
+
This function is initialised with another CIL function, :math:`H` in the above formula. When this function is called, first the absolute value of the input is taken, and then the input is passed to the provided function.
42
+
43
+
Included in this class is the proximal map for FunctionOfAbs. From this, the proximal conjugate is also available from the parent CIL Function class, which is valid for this function.
44
+
In the case that :math:`H` is lower semi-continuous, convex, non-decreasing and finite at the origin, (and thus `assume_lower_semi` is set to `True` in the `init`) the convex conjugate is also defined.
45
+
The gradient is not defined for this function.
46
+
47
+
For reference: see https://doi.org/10.48550/arXiv.2410.22161
48
+
49
+
Parameters
50
+
----------
51
+
function : Function
52
+
Function acting on a real input, :math:`H` in the above formula.
53
+
assume_lower_semi : bool, default False
54
+
If True, assume that the function is lower semi-continuous, convex, non-decreasing and finite at the origin.
55
+
This allows the convex conjugate to be calculated as the monotone conjugate, which is less than or equal to the convex conjugate.
56
+
If False, the convex conjugate returned as 0. This is to ensure compatibility with Algorithms such as PDHG.
This is accomplished by calculating a bounded proximal map and making a change of phase,
76
+
:math:`prox_G(z) = prox^+_H(r) \circ \Phi` where :math:`z = r \circ \Phi`, :math:`r = abs(z)`, :math:`\Phi = \exp(i \angle(z))`,
77
+
and :math:`\circ` is element-wise product. Also define :math:`prox^+` to be the proximal map of :math:`H` in which the minimisation carried out over the positive orthant.
78
+
79
+
80
+
Parameters
81
+
----------
82
+
x : DataContainer
83
+
The input to the function
84
+
tau: scalar
85
+
The scalar multiplying the function in the proximal map
86
+
out: return DataContainer, if None a new DataContainer is returned, default None.
87
+
DataContainer to store the result of the proximal map
88
+
89
+
90
+
Returns
91
+
-------
92
+
DataContainer, the proximal map of the function at x with scalar :math:`\tau`.
0 commit comments