-
Notifications
You must be signed in to change notification settings - Fork 17
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
remove is_smooth attribute (#89) #184
Changes from 1 commit
f11ba55
0fdfcf6
5fb2887
02fe9bb
590d99a
5af596b
5473521
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,8 +387,7 @@ class PGM: | |
|
||
Minimize a function of the form :math:`f(\mb{x}) + g(\mb{x})`. | ||
|
||
The function :math:`f` must be smooth and :math:`g` must have a | ||
defined prox. | ||
The function :math:`g` must have a defined prox. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's worth mentioning that f should be smooth, but that the algorithm will work for f with points at which it's non-smooth as long as those points are not visited during the optimization. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will at also work if valid subgradients are returned for nonsmooth points? It would be valuable to say so (with a ref) if it is true. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps @crstngc can comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Generally agree, however,
Does as long as mean the same as if and only if? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's say guaranteed to work if globally smooth (leaving it open to the interpretation of the user what happens with not globally smooth losses) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See 02fe9bb There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bwohlberg please merge if you are happy with this. |
||
|
||
Uses helper :class:`StepSize` to provide an estimate of the Lipschitz | ||
constant :math:`L` of :math:`f`. The step size :math:`\alpha` is the | ||
|
@@ -428,9 +427,6 @@ def __init__( | |
this parameter. | ||
""" | ||
|
||
if f.is_smooth is not True: | ||
raise Exception(f"The functional f ({type(f)}) must be smooth.") | ||
|
||
#: Functional or Loss to minimize; must have grad method defined. | ||
self.f: Union[Loss, Functional] = f | ||
|
||
|
@@ -556,9 +552,8 @@ class AcceleratedPGM(PGM): | |
|
||
Minimize a function of the form :math:`f(\mb{x}) + g(\mb{x})`. | ||
|
||
The function :math:`f` must be smooth and :math:`g` must have a | ||
defined prox. The accelerated form of PGM is also known as FISTA | ||
:cite:`beck-2009-fast`. | ||
The function :math:`g` must have a defined prox. The accelerated | ||
form of PGM is also known as FISTA :cite:`beck-2009-fast`. | ||
|
||
For documentation on inherited attributes, see :class:`.PGM`. | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refer to part of the jax docs to expand on this? Also, considering using markup (e.g. Note) rather than all caps for emphasis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look this morning and could not find any clear discussion of this in the jax docs. I can at least confirm that the statement is sometimes true, e.g.,
jax.grad(lambda x: jnp.abs(x))(0.0) == 1.0
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is an easier example because x is defined everywhere else but at 0.
Where it breaks is e.g. at
x / (1 + jnp.sqrt(x))
whichgrad
s tonan
at zero. SeeI don't know what the general rule for scico is, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 0fdfcf6