Skip to content

Docs: Custom algorithms - #108

Merged
aldma merged 5 commits into
JuliaFirstOrder:masterfrom
aldma:docs-custom-algo
Nov 28, 2026
Merged

aldma merged 5 commits into
JuliaFirstOrder:masterfrom
aldma:docs-custom-algo

Conversation

@aldma

@aldma aldma commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

This PR is intended to the Custom algorithms section in the documentation, at https://juliafirstorder.github.io/ProximalAlgorithms.jl/stable/guide/custom_algorithms/.

This PR

  • introduces the rationale behind ProximalAlgorithms.IterativeAlgorithm,
  • gives a usage example for a custom algorithm: restarted FISTA,
  • gives an example of a custom stop function for logging along the iterations.

@lostella
lostella self-requested a review November 20, 2026 12:12
@aldma

aldma commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

once this has been merged, perhaps it's time for v0.7.1

function ProximalAlgorithms.value_and_gradient(f::LeastSquares, x)
tmp = f.A * x - f.b
fx = 0.5*norm(tmp, 2)^2
dfx = f.A' * tmp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle the function could have a coefficient lambda (default 1), which is not accounted here https://juliafirstorder.github.io/ProximalOperators.jl/latest/functions/#ProximalOperators.LeastSquares

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value f.lambda is now considered in value_and_gradient(f::LeastSquares, x). Is that what you meant?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@lostella lostella left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Only a small inline comment

@aldma
aldma requested a review from lostella November 28, 2026 16:29
@aldma
aldma merged commit cc7738a into JuliaFirstOrder:master Nov 28, 2026
8 checks passed
@aldma
aldma deleted the docs-custom-algo branch November 28, 2026 20:27
lostella referenced this pull request Nov 29, 2026
Co-authored-by: Alberto De Marchi <aldmarchi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants