-
Notifications
You must be signed in to change notification settings - Fork 29
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
Plotting error measures during groundstate searches #105
Comments
I recently changed the logging within the algorithms to allow for something similar, but haven't gotten around to playing with it some more. They now attach some variables to the log messages, that you could access through a custom logger. This would then be able to be handled with something like a unicode plot, or a progress meter, etc. I'd recommend having a look at LoggingExtras for more information. |
This sounds like a better approach indeed. |
Even the finalize approach should work. You can keep track of the history
by doing something like:
history = []
function finalize(a,b,c,...)
push!(history,a)
return ...
end
Op do 28 dec 2023 om 13:15 schreef Gertian ***@***.***>:
… This sounds like a better approach indeed.
I looked into the finalize thing and this was slightly problematic because
the function can only take input from the current state of the GS search
—
Reply to this email directly, view it on GitHub
<#105 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJKVCS7GL4IWT6KQN6VXX3YLVPFLAVCNFSM6AAAAABAT3QM5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZRGEYTCNJUGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@maartenvd and @lkdvos As maarten suggested I ended up fixing this using finalize. In particular we now have : function finalize_saver(x, f, g, numiter) #x = state, f = costfun(x), g = gradient(f(x)), numiter = iteration
@info "I'm also updating the $(status_file) file"
normgrad = sqrt(GrassmannMPS.inner(x,g,g))
open("status_file", "a") do file
write(file, "sinval = $sinval, iter = $numiter, f = $f \t normgrad = $normgrad > $( sinval*extra_accuracy )\n")
end
return x,f,g
end and then I use external software to read and plot the status_file. If it's up to me this thread can be closed 👍 |
When performing groundstate searches requiring many iterations it is desirable to have some notion of convergence speed to estimate runtime on clusters and better help planning.
I used to have an implementation of this using UnicodePlots.jl which can run in any terminal.
I was thinking about re-implementing this and was wondering how such functionality would fit most elegantly within the current framework. I suspect the finalize function can be used for this ? Alternatively it might be implemented as a verbosity setting.
The text was updated successfully, but these errors were encountered: