-
Notifications
You must be signed in to change notification settings - Fork 6
Refactor SemOptimizer API #299
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
base: devel
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #299 +/- ##
==========================================
- Coverage 72.94% 72.15% -0.80%
==========================================
Files 50 51 +1
Lines 2218 2216 -2
==========================================
- Hits 1618 1599 -19
- Misses 600 617 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This reverts commit 9729819.
This reverts commit 81a4bd9.
This reverts commit f0df653.
It is a simple and intuitive syntax and avoids declaring new types. Also allow specifying default constraint tolerance as `constraint_tol`.
use SemOptimizer(engine = :NLopt) instead of SemOptimizerNLopt() as this is a more universal scheme
It works around docstring errors during SemOptimizer{:E} parsing.
Instead of engine-specific subtype as it might be not available in the user session.
fe23e46 to
8dacd43
Compare
|
Rebased to the current devel |
since it moved from struct to ctor
|
|
||
| """ | ||
| Uses *NLopt.jl* as the optimization engine. | ||
| Only available if *NLopt.jl* is loaded in the current Julia session! |
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.
[JuliaFormatter] reported by reviewdog 🐶
| Only available if *NLopt.jl* is loaded in the current Julia session! | |
| !isa(inequality_constraints, NamedTuple) || |
| When [`NLopt.jl`](https://github.com/jump-dev/NLopt.jl) is loaded in the running Julia session, | ||
| it could be used by the [`SemOptimizer`](@ref) by specifying `engine = :NLopt` | ||
| (see [NLopt-specific options](@ref `SemOptimizer(Val(:NLopt))`)). | ||
| Among other things, `NLopt` enables constrained optimization of the SEM models, which is | ||
| explained in the [Constrained optimization](@ref) section. |
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.
| When [`NLopt.jl`](https://github.com/jump-dev/NLopt.jl) is loaded in the running Julia session, | |
| it could be used by the [`SemOptimizer`](@ref) by specifying `engine = :NLopt` | |
| (see [NLopt-specific options](@ref `SemOptimizer(Val(:NLopt))`)). | |
| Among other things, `NLopt` enables constrained optimization of the SEM models, which is | |
| explained in the [Constrained optimization](@ref) section. | |
| When [`NLopt.jl`](https://github.com/jump-dev/NLopt.jl) is loaded in the running Julia session, | |
| it can be used by the [`SemOptimizer`](@ref) by specifying `engine = :NLopt` | |
| (see [NLopt-specific options](@ref `SemOptimizer(Val(:NLopt))`)). | |
| Among other things, `NLopt` enables constrained optimization of SEMs, which is | |
| explained in the [Constrained optimization](@ref) section. |
| To choose an algorithm, just pass its name without the 'NLOPT\_' prefix (for example, 'NLOPT\_LD\_SLSQP' can be used by passing `algorithm = :LD_SLSQP`). | ||
|
|
||
| The README of the [julia package](https://github.com/JuliaOpt/NLopt.jl) may also be helpful, and provides a list of options: | ||
| The README of the [*NLopt.jl*](https://github.com/JuliaOpt/NLopt.jl) may also be helpful, and provides a list of options: |
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.
| The README of the [*NLopt.jl*](https://github.com/JuliaOpt/NLopt.jl) may also be helpful, and provides a list of options: | |
| The README of [*NLopt.jl*](https://github.com/JuliaOpt/NLopt.jl) may also be helpful, and provides a list of options: |
| You can define lasso, elastic net and other forms of regularization using [`ProximalOperators.jl`](https://github.com/JuliaFirstOrder/ProximalOperators.jl) | ||
| and optimize the SEM model with [`ProximalAlgorithms.jl`](https://github.com/JuliaFirstOrder/ProximalAlgorithms.jl) | ||
| that provides so-called *proximal optimization* algorithms. |
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.
| You can define lasso, elastic net and other forms of regularization using [`ProximalOperators.jl`](https://github.com/JuliaFirstOrder/ProximalOperators.jl) | |
| and optimize the SEM model with [`ProximalAlgorithms.jl`](https://github.com/JuliaFirstOrder/ProximalAlgorithms.jl) | |
| that provides so-called *proximal optimization* algorithms. | |
| You can define lasso, elastic net and other forms of regularization using [`ProximalOperators.jl`](https://github.com/JuliaFirstOrder/ProximalOperators.jl) | |
| and optimize the SEM with so-called *proximal optimization* algorithms from [`ProximalAlgorithms.jl`](https://github.com/JuliaFirstOrder/ProximalAlgorithms.jl). |
| With *ProximalAlgorithms* package loaded, it is now possible to use `:Proximal` optimization engine | ||
| in `SemOptimizer` for estimating regularized models. |
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.
| With *ProximalAlgorithms* package loaded, it is now possible to use `:Proximal` optimization engine | |
| in `SemOptimizer` for estimating regularized models. | |
| With the *ProximalAlgorithms* package loaded, it is now possible to use the `:Proximal` optimization engine | |
| in `SemOptimizer` for estimating regularized models. |
| To define a sup of separable proximal operators (i.e. no parameter is penalized twice), | ||
| we can use [`SlicedSeparableSum`](https://juliafirstorder.github.io/ProximalOperators.jl/stable/calculus/#ProximalOperators.SlicedSeparableSum) from the `ProximalOperators` package: | ||
| Since we apply *l1* and *l0* to the disjoint sets of parameters, this regularization could be represented as | ||
| as sum of *separable proximal operators* (i.e. no parameter is penalized twice) |
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.
| as sum of *separable proximal operators* (i.e. no parameter is penalized twice) | |
| a sum of *separable proximal operators* (i.e. no parameter is penalized twice) |
|
I opened alyst#4 to try to streamline the access of the docs a bit further - let me know what you think. |
Extracted from #245 -- moving all engine-specific code (types) into extensions for modularity and leaner API, updating docstrings to make all optimizer help available for the user.
Requires #245 to be merged first.