Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
(docs incomplete)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
@lkdvos besides testing this on a small dummy algorithm in the test suite, this should be ready so far. A next step would be to boost stopping criteria:
Let me know what you think about the current start both in code and docs. |
|
I started adding a dummy tests which currently don't work.
function solve!(p::Problem, a::Algorithm, s::State)
state = initialize_state!(s, p, a)
while !isfinished(p, a, s)
state = step!(s, p, a)
end
return get_solution(s, p, a)
end
struct StopAfterIteration
max_iterations::Int
endie, the information that tells you what kind of criterium (through its type), and the settings for that. This is the information that is static, and would therefore belong in the alg = my_algorithm_settings(; kwargs...)
for param in all_parameters
problem = Problem(param)
solve(problem, alg)
endIf I now change
|
|
Interesting discussion points! Though especially with the stopping criterion (SC) I fear we are much further away from a first prototype than I thought.
|
|
I thought a bit about the SC. I can give the following idea a try tomorrow, though for combined ons I am not yet so convinced ;) We take This could still be a functor, maybe parametrized – that should work. The tricky part is what to do with a |
Although I guess the mutated argument should always be the The For the stopping criterium state, we could also do what you suggested, with less enforcement on the type of the states a stopping criterium has: struct StoppingCriteriumState{SC<:StoppingCriterium,SS}
stopping_criteria::SC
stopping_state::SS
end
StoppingCriteriumState(criterium::StopWhenAny) = StoppingCriteriumState(criterium, StoppingCriteriumState.(criterium.stopping_criteria))in other words, really having a tuple of states. |
Would just be a bit unusual for me, since I ordered that the other way around for 9 years now, but well.... you are right there is not so much variation when all 3 appear. We could then also go for
Sure we can have that as an
I will try both my and your idea the next few days, for me a crucial thing for the user to be able to state is something like but I do agree that that is static data for the Algorithm and hence not for the state. On the other hand both your and my approach “double” the static data into the state now. So maybe also
os a good functor to have, so one can dispatch on the first argument mainly but has access to all other information. That looks reasonable to me – might still require different SCStates, but I can check. |
but forgot to pull, so interms commit to merge real quick.
…orithmsInterface.jl into kellertuer/main-types
|
After a longer walk this morning and about an hour of re-hacking a lot of things (instead of grading what I should have started with by now ;)) I followed the same route as with
The main Idea I had was to reuse the For the functor signature I also went for that order instead of the one above – I am not yet sure what is the best order here; I feel the stopping criterion should probably either be first (most important there), but that would be a bit inconsistent with other signatures, or maybe be third (so before state) since it is the “smallest” part of the static variables. But besides this question of argument order, I think I like the new more strict split between algorithm/static and state/dynamic date also in stopping criteria (though this will be heavily breaking for Manopt internals at least). Let me know what you think and what you feel about the argument order. |
|
For me the second is nice to read but I always feel like I am cheating when writing a new I think for now the things we want to provide access to are
|
|
I tend to be okay with new property functions whenever this really is a property, ie a trivial amount of work is required to compute it, otherwise I feel functions are definitely more appropriate. From the language point of view it ultimately really doesn't matter, one is just a bit of syntactic sugar around the other so 🤷 |
|
Yeah, and I do not have so strong of a preference, maybe |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
To me this feels more or less in a state where I'd be okay with merging and starting to try it out. In any case, I'd do this in a separate PR and merge this one first though, that might be a bit easier to keep track of discussions etc. |
|
Oh I think I would prefer to maybe at least try one state decorator like a debug (cf the Manopt debug) before a 0.1? But sure I can also do that in a 0.1.1. I have to take a look at your property changes, but besides that I only have the remark I already posted. |
|
I do agree, the Before we release a 1.0 (but maybe not on this branch) I would like to
|
…olds/AlgorithmsInterface.jl into kellertuer/main-types
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Nice! We are for now only at 45% coverage, but if you really want to try it already, sure we can do a first version. I would prefer to wait a bit with my experiments and first at least get the debug and a first factory (to generate debug states) redone here. I could use such a PR also to work further on CodeCov. |
|
Sure, so then let's merge this, but hold off on registration? |
|
Yes. Could you do that? I am on mobile. Commenting is great but much more in GitHub ... a bit challenging. |
|
Oh do we have Talbot and everything (JluiaRegistrator?) in place? |
|
Looks like we do. I've left the docs action as is, since it still contains some of the quarto things, but I'm sure we can figure that out in coming commits/prs. |
|
Quarto is for later tutorials and I was lazy to keep it in ;) But yes we can check that along the way. |
Here are the first few steps from our discussion
📋
Algorithm,Problem,State)StoppingCriterionstarted💬
A sorted list of the discussion points below – with (L)etters to refer to, to make the whole discussion a bit more structured – and a checkbox to mark to indicate when the discussion is both finished and realised in code
(problem, algorithm, state)orstate, problem, algorithm)?solve!should return the state it modifiedis_finishedcan just return the current answer whileis_finished!would also update internal state, e.g. also store the last iterate againthat way also internal things could access this again without modifying the stopping criterions state (it would call
is_finished, update state, return result)is_finishedcomputing change
get_X/is_Xor justX? (currentlyget_Xis used to allow forset_X!as wellalgorithminstead of justaget_reasonto return nothing instead of an empty string, when not yet finishedBase.summaryto show the summary of a state