-
Notifications
You must be signed in to change notification settings - Fork 234
Closed
Description
Reviving #84
printing the iteration history is useful when you are developing and experimenting, but as user you probably don't want to see it and still get some progress information?
Here are two variants I cooked up, which I both like, and both can probably be fine-tuned quite nicely.
using ProgressMeter
prog = ProgressThresh(1e-8, "Minimizing:")
df(x) = 4*x^3 - 2*x + 0.8
x = 1.0
h = 0.1
while df(x) > 1e-8
x -= h * df(x)
ProgressMeter.update!(prog, abs(df(x)))
sleep(0.3)
end
using ProgressMeter
TOL = 1e-8
GRAN = 100
prog = Progress(floor(Int, GRAN * abs(log(TOL))), desc = "Minimizing:")
df(x) = 4*x^3 - 2*x + 0.8
x = 1.0
h = 0.1
while df(x) > TOL
x -= h * df(x)
ProgressMeter.update!(prog, ceil(Int, GRAN * abs(log(abs(df(x))))))
sleep(0.3)
end
johnmyleswhite and aakhmetz
Metadata
Metadata
Assignees
Labels
No labels