-
Notifications
You must be signed in to change notification settings - Fork 40
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
Rework Problem structure to have a Objective for reusing interim computations and a Cache #174
Conversation
# Conflicts: # src/plans/hessian_plan.jl # src/solvers/truncated_conjugate_gradient_descent.jl # src/solvers/trust_regions.jl
* Rename Problem to AbstractManoptProblem * Introduce an AbstractManifoldObjective * Rename solve to solve!
Status I: After introducing the new structure, the cost problems (Nelder Mead, particle swarm) seem to work already with only reasonable rework of code. |
I like Pluto in general, just within docs, especially with tutorials that should be up to date to the most recent version that is a hustle and the results don't look that nice. Even more – one of the notebooks sometimes stalls and I can‘t figure out why, because it only happens on CI and there is never any feedback / message. For ManoptExamples I might use mainly Pluto Notebooks to illustrate how the examples work, since there its fine if that refers to an old version. I fixed the docs and even see roughly how I could fix the remaining 13 lines of coverage – but I also would like to finish this somewhen. Sure a test with the PCA would be great, as soon as the ManifoldDiff PR is merged we can check here what we can remove when we introduce the dependency. |
I started a-roping most of the code to ManifoldDiff – however my For neither of them I have a clue where that comes from nor how to solve that (spent the last half hour on them). edit: Ah, I see the new adjoint Jacobi fields do not yet work on manifold like |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Found my bug – now the only thing left is Jacobi fields for circle and such... |
For the remaining tests here to pass, we would need JuliaManifolds/ManifoldDiff.jl#11, but the rest is done. |
Sure, I will fix nonmutating manifolds in a moment. |
Hm, it doesn't look like Jacobi fields actually work for PositiveNumbers. I will just fix Circle and Euclidean for now. |
That is, there is no diagonalizing basis for PositiveNumbers currently. |
Ok, that basis is a very boring one, but sure, my main application is actually the circle, though I covered |
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 caching requires some additional work but I don't really have enough time to work on it now. It will have to wait. In the meantime maybe it would be a good idea to add a note that it's an experimental feature for now?
I think the simple cache should be fine, but sure, that is just a first step and we could also call that experimental for now. |
I also opened #192 concerning the next steps in Caching. |
This is a little bit of a (slowly progressing) rework of the Problem structure to enable that a cost and a grad can be the same function and we might be able to cache interims results. This resolves #172.
Features introduced in Manopt 0.4
Problem
->AbstractManoptProblem
AbstractManifoldObjective
to store all information about the objectiveDefaultManoptProblem
when it (just) constains the manifold and anAbstractManifoldObjective
<:AbstractManifoldObjective
s within a newDefaultManoptProblem
(which has the manifold and the objective).AlternatingGradientProblem
is now aManifoldAlternatingGradientObjective
CostProblem
now is aManifoldCostObjective
GradientProlem
now is aManifoldGradientObjective
StochasticGradientProblem
is now aManifoldStochasticGradientObjective
SubgradientProblem
is now aManifoldSubgradientObjective
PrimalDualProblem
is now aTwoManifoldProblem
with two new cost structuresConstrainedProblem
is now aConstrainedManifoldObjective
ProximalProblem
is now aManifoldProximalMapsObjective
HessianProblem
is now aManifoldHessianObjective
NonlinearLeastSquaresObjective
is now aNonlinearLeastSquaresObjective
Options
toAbstractManoptSolverState
solve
tosolve!
@deprecated
constructors (those without manifold first – so without manifold defaults)unify usage ofFieldReference
in the accessor functions.SimpleCacheObjective
that stores one recent point and/or gradient in astorage
, resolves MakeDebugWarnIfCostIncreases
not call objective when possible #171random_point
andrandom_tangent
in favour or therand
functions from Manifolds.jl (if that is loaded), resolvesrandom_point
andrandom_tangent
#178default_stepsize(M, mp)
that returns a default stepwise functor based on the Manifold and problem combination, resolves Introducedefault_stepsize(M, O)
#180ManifoldCostGradObjective
with one function computing cost and gradient simultaneously A combined CostGrad structure #139Think about a genericpostponed to later.CachedManifoldObjective
with a generic cache with more than one value stored.check_gradient
to return the figure but not show it necessarily. That way the plot can be suppressed.ManifoldDiff
and remove the corresponding functions from here (resolves Differentials and adjoint differentials in ManifoldDiff.jl #177)