You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a feature to the progress bar that displays additional variables … (#256)
* Add a feature to the progress bar that displays additional variables and their values.
```julia
using Term.Progress
a = 10
b = 0.1
extra_info = Dict("Current loss" => a, "Learning rate" => b)
pbar = ProgressBar(; extra_info)
job = addjob!(pbar; N = 5)
start!(pbar)
for i in 1:5
a = 10-i
b = 0.1i
println("Epoch $i")
pbar.extra_info = Dict("Current loss" => a, "Learning rate" => b)
update!(job)
render(pbar)
sleep(1)
end
stop!(pbar)
```
And the output will be:
```
Epoch 1
...
─────────────────────────── progress ───────────────────────────
Running... ● ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ● 5/5 100%
Current loss : 5
Learning rate : 0.5
```
modified: src/progress.jl
* Modify the results of the test set corresponding to https://github.com/abcdvvvv/Term.jl/blob/4145a63d52c1185cb828f162931e7d8103a71545/src/progress.jl#L115
modified: test/15_test_progress.jl
0 commit comments