Skip to content

fix progress bar when step_size>1

Vicentini Filippo requested to merge pv/fix into master

Created by: PhilipVinc

The display of the progress bar was broken for step_size>1 (everything worked. Only the display was broken)

Running ising1d/ising1d.py with step_size=10 and a callback printing the step:

current master

netket on  pv/fix [$!] via netket_env via 🐍 system took 11s 
 python -i Examples/Ising1d/ising1d.py 
No output specified (out=[apath|nk.logging.JsonLogger(...)]).Running the optimization but not saving the output.
  0%|                                             | 0/100 [00:02<?, ?it/s, Energy=-20.06 ± 0.14 [σ²=19.66, R̂=0.9989]]]
 step=0
  1%|                                    | 1/100 [00:00<00:32,  3.05it/s, Energy=-20.75 ± 0.13 [σ²=16.08, R̂=1.0022]]
 step=10
  3%|                                  | 3/100 [00:00<00:10,  9.15it/s, Energy=-23.733 ± 0.060 [σ²=3.629, R̂=1.0012]]
 step=20
  3%|                                  | 3/100 [00:00<00:10,  9.15it/s, Energy=-24.145 ± 0.054 [σ²=2.950, R̂=0.9960]]
 step=30
  4%|█▍                                 | 4/100 [00:01<00:22,  4.27it/s, Energy=-24.190 ± 0.051 [σ²=2.673, R̂=0.9961]]
 step=40
  5%|█▊                                 | 5/100 [00:01<00:22,  4.18it/s, Energy=-24.345 ± 0.051 [σ²=2.608, R̂=0.9986]]
 step=50
  6%|██                                 | 6/100 [00:01<00:22,  4.12it/s, Energy=-24.465 ± 0.048 [σ²=2.279, R̂=0.9977]]
 step=60
  7%|██▍                                | 7/100 [00:01<00:22,  4.08it/s, Energy=-25.087 ± 0.043 [σ²=1.827, R̂=1.0030]]
 step=70
  8%|██▊                                | 8/100 [00:02<00:22,  4.05it/s, Energy=-25.131 ± 0.044 [σ²=1.951, R̂=1.0101]]
 step=80
  9%|███▏                               | 9/100 [00:02<00:22,  4.00it/s, Energy=-25.276 ± 0.036 [σ²=1.320, R̂=1.0055]]
 step=90
 10%|███▍                              | 10/100 [00:02<00:23,  3.90it/s, Energy=-25.276 ± 0.036 [σ²=1.320, R̂=1.0055]]
>>>

this pr

No output specified (out=[apath|nk.logging.JsonLogger(...)]).Running the optimization but not saving the output.
  0%|                                             | 0/100 [00:02<?, ?it/s, Energy=-19.84 ± 0.14 [σ²=19.61, R̂=0.9953]]]
 step=0
  0%|                                             | 0/100 [00:03<?, ?it/s, Energy=-20.91 ± 0.13 [σ²=17.00, R̂=0.9976]]
 step=10
 10%|███▍                              | 10/100 [00:03<00:02, 37.45it/s, Energy=-23.316 ± 0.060 [σ²=3.612, R̂=0.9991]]
 step=20
 20%|██████▊                           | 20/100 [00:03<00:02, 39.72it/s, Energy=-24.033 ± 0.054 [σ²=2.989, R̂=1.0004]]
 step=30
 30%|██████████▏                       | 30/100 [00:03<00:01, 40.45it/s, Energy=-24.252 ± 0.045 [σ²=2.030, R̂=1.0011]]
 step=40
 40%|█████████████▌                    | 40/100 [00:03<00:01, 40.49it/s, Energy=-24.370 ± 0.045 [σ²=2.010, R̂=0.9980]]
 step=50
 50%|█████████████████                 | 50/100 [00:04<00:01, 40.87it/s, Energy=-24.512 ± 0.044 [σ²=1.910, R̂=0.9993]]
 step=60
 60%|████████████████████▍             | 60/100 [00:04<00:00, 40.92it/s, Energy=-25.175 ± 0.032 [σ²=1.009, R̂=1.0044]]
 step=70
 70%|███████████████████████▊          | 70/100 [00:04<00:00, 40.55it/s, Energy=-25.184 ± 0.029 [σ²=0.861, R̂=1.0001]]
 step=80
 80%|███████████████████████████▏      | 80/100 [00:04<00:00, 40.09it/s, Energy=-25.260 ± 0.032 [σ²=1.044, R̂=1.0014]]
 step=90
100%|█████████████████████████████████| 100/100 [00:05<00:00, 19.14it/s, Energy=-25.260 ± 0.032 [σ²=1.044, R̂=1.0014]]
>>> 

Merge request reports