Skip to content

Setup progress bar of sciml_train to be platform agnostic #158

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

Closed
ChrisRackauckas opened this issue Feb 16, 2020 · 2 comments · Fixed by #184
Closed

Setup progress bar of sciml_train to be platform agnostic #158

ChrisRackauckas opened this issue Feb 16, 2020 · 2 comments · Fixed by #184
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ChrisRackauckas
Copy link
Member

https://github.com/JuliaDiffEq/OrdinaryDiffEq.jl/blob/10efbd7e331f181379118d9e8e4b6a4c5e2216b8/src/solve.jl#L89

https://github.com/JuliaDiffEq/OrdinaryDiffEq.jl/blob/311726795dabdabe50a8392d753213b6d5d74c2e/src/integrators/integrator_utils.jl#L132-L136

is how it should be done. Then it should auto-switch over to command line tools. @tkf are the command line tools done?

@ChrisRackauckas ChrisRackauckas added good first issue Good for newcomers help wanted Extra attention is needed labels Feb 16, 2020
@ChrisRackauckas ChrisRackauckas changed the title Setup progress bar to be platform agnostic Setup progress bar of sciml_train to be platform agnostic Feb 16, 2020
@tkf
Copy link

tkf commented Feb 16, 2020

Do you mean a terminal-based progress bar UI? There is https://github.com/c42f/TerminalLoggers.jl so it should work now. A toy example:

using Logging
using OrdinaryDiffEq
using TerminalLoggers

with_logger(TerminalLogger()) do
    solve(
        ODEProblem((u, p, t) -> (sleep(0.01); -u), 1.0, nothing),
        Euler();
        dt = 0.5,
        tspan = (0.0, 100.0),
        progress = true,
        progress_steps = 1,
    )
end

FYI, ideally,

  • It'd be better to generate a UUID when creating a solver and store it to (e.g.) integrator.progress_id. Then, you can pass it to the _id argument of @logmsg. This matters only if you want to solve a diffeq inside another difffeq, though.
  • Use try-finally in solve etc. to make sure you do @logmsg with "done". Otherwise, progress bar UI can't tell the difference between very slow integration/training and crashed integration/training.

The next version of ProgressLogging.jl (a Juno.jl spin-off) is going to have ProgressLogging.@withprogress etc. that helps to do get these things right easily.

@ChrisRackauckas
Copy link
Member Author

@Vaibhavdixit02 @abhigupta768 reopening to make this just a little more automatic, following @devmotion's lead:

SciML/DiffEqBase.jl#454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants