Skip to content
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

The log table is too verbose #50

Open
odow opened this issue Oct 28, 2024 · 2 comments
Open

The log table is too verbose #50

odow opened this issue Oct 28, 2024 · 2 comments
Assignees

Comments

@odow
Copy link
Contributor

odow commented Oct 28, 2024

The default is

┌───────┬─────────┬────────────────┬─────────────┬───────┬────────────────┬──────────────┬─────────────┬──────────────┬─────────────────┬────────────────────────┐
│ iter  │ LS iter │ barrier param. │ step length │ phase │ regularization │ step norm    │ objective   │ stationarity │ complementarity │ status                 │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 0     │ -       │ -              │ -           │ OPT   │ -              │ -            │ 1           │ 2            │ 0               │ initial point          │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 1     │ 1       │ 0.1            │ 1           │ OPT   │ 0              │ 1            │ 100         │ -            │ -               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -     │ 2       │ -              │ 0.5         │ -     │ -              │ 0.5          │ 6.5         │ -            │ -               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -     │ 3       │ -              │ 0.25        │ -     │ -              │ 0.25         │ 0.953125    │ 12.5         │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 2     │ 1       │ 0.1            │ 1           │ OPT   │ 0              │ 0.0902778    │ 0.483206    │ 1.01166      │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 3     │ 1       │ 0.1            │ 1           │ OPT   │ 0              │ 0.429389     │ 3.46968     │ -            │ -               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -     │ 2       │ -              │ 0.5         │ -     │ -              │ 0.214695     │ 0.457088    │ 9.5274       │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 4     │ 1       │ 0.1            │ 1           │ OPT   │ 0              │ 0.0950542    │ 0.188942    │ 0.415353     │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 5     │ 1       │ 0.02           │ 1           │ OPT   │ 0              │ 0.349223     │ 0.901785    │ -            │ -               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -     │ 2       │ -              │ 0.5         │ -     │ -              │ 0.174612     │ 0.139187    │ 6.5051       │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 6     │ 1       │ 0.02           │ 1           │ OPT   │ 0              │ 0.092873     │ 0.054941    │ 0.451043     │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 7     │ 1       │ 0.02           │ 1           │ OPT   │ 0              │ 0.248802     │ 0.0720927   │ -            │ -               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -     │ 2       │ -              │ 0.5         │ -     │ -              │ 0.124401     │ 0.0291446   │ 2.26614      │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 8     │ 1       │ 0.02           │ 1           │ OPT   │ 0              │ 0.11047      │ 0.00985865  │ 1.15467      │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 9     │ 1       │ 0.02           │ 1           │ OPT   │ 0              │ 0.100021     │ 0.00232375  │ 1.00373      │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ iter  │ LS iter │ barrier param. │ step length │ phase │ regularization │ step norm    │ objective   │ stationarity │ complementarity │ status                 │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 10    │ 1       │ 0.02           │ 1           │ OPT   │ 0              │ 0.0509267    │ 0.000237972 │ 0.218984     │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 11    │ 1       │ 0.02           │ 1           │ OPT   │ 0              │ 0.0253247    │ 4.92674e-06 │ 0.0595169    │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 12    │ 1       │ 0.00282843     │ 1           │ OPT   │ 0              │ 0.00319684   │ 2.81895e-09 │ 0.000831455  │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 13    │ 1       │ 1.84491e-06    │ 1           │ OPT   │ 0              │ 9.78057e-05  │ 8.88178e-16 │ 8.67623e-07  │ 0               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 14    │ 1       │ 2.5059e-09     │ 1           │ OPT   │ 0              │ 4.65423e-08  │ 0           │ 2.46136e-13  │ 0               │ accepted (f-type)      │
└───────┴─────────┴────────────────┴─────────────┴───────┴────────────────┴──────────────┴─────────────┴──────────────┴─────────────────┴────────────────────────┘

To my eyes, an improvement is

┌───────┬─────────┬────────────────┬─────────────┬───────┬────────────────┬──────────────┬─────────────┬──────────────┬─────────────────┬────────────────────────┐
│ iter  │ LS iter │ barrier param. │ step length │ phase │ regularization │ step norm    │ objective   │ stationarity │ complementarity │ status                 │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 0---           │ OPT   │ --120               │ initial point          │
│ 110.11           │ OPT   │ 01100--               │ rejected (f-type)      │
│ -2-0.5--0.56.5--               │ rejected (f-type)      │
│ -3-0.25--0.250.95312512.50               │ accepted (f-type)      │
│ 210.11           │ OPT   │ 00.09027780.4832061.011660               │ accepted (f-type)      │
│ 310.11           │ OPT   │ 00.4293893.46968--               │ rejected (f-type)      │
│ -2-0.5--0.2146950.4570889.52740               │ accepted (f-type)      │
│ 410.11           │ OPT   │ 00.09505420.1889420.4153530               │ accepted (f-type)      │
│ 510.021           │ OPT   │ 00.3492230.901785--               │ rejected (f-type)      │
│ -2-0.5--0.1746120.1391876.50510               │ accepted (f-type)      │
│ 610.021           │ OPT   │ 00.0928730.0549410.4510430               │ accepted (f-type)      │
│ 710.021           │ OPT   │ 00.2488020.0720927--               │ rejected (f-type)      │
│ -2-0.5--0.1244010.02914462.266140               │ accepted (f-type)      │
│ 810.021           │ OPT   │ 00.110470.009858651.154670               │ accepted (f-type)      │
│ 910.021           │ OPT   │ 00.1000210.002323751.003730               │ accepted (f-type)      │
│ 1010.021           │ OPT   │ 00.05092670.0002379720.2189840               │ accepted (f-type)      │
│ 1110.021           │ OPT   │ 00.02532474.92674e-060.05951690               │ accepted (f-type)      │
│ 1210.002828431           │ OPT   │ 00.003196842.81895e-090.0008314550               │ accepted (f-type)      │
│ 1311.84491e-061           │ OPT   │ 09.78057e-058.88178e-168.67623e-070               │ accepted (f-type)      │
│ 1412.5059e-091           │ OPT   │ 04.65423e-0802.46136e-130               │ accepted (f-type)      │
└───────┴─────────┴────────────────┴─────────────┴───────┴────────────────┴──────────────┴─────────────┴──────────────┴─────────────────┴────────────────────────┘

and then you could unify on a fixed scientific precision (I didn't do the stat column):

───────────────────────────────────────────────────────────────────────────────────────────────────
iter  barrier    step phase reg. step_norm    obj.       stat.       comp.      status           
───────────────────────────────────────────────────────────────────────────────────────────────────
 0                    OPT                    1.0000e+00  2             0.0000e+00 
 1 1  1.0000e-02 1    OPT   0    1.0000e+00  1.0000e+02                           rejected (f-type)
   2             0.5  -     -    5.0000e-02  6.5000e+00                           rejected (f-type)
   3             0.25 -     -    2.5000e-02  9.5312e-02  12.5          0.0000e+00 accepted (f-type)
 2 1  1.0000e-02 1    OPT   0    0.9027e-02  4.8320e-02  1.01166       0.0000e+00 accepted (f-type)
 3 1  1.0000e-02 1    OPT   0    4.2938e-02  4.8320e-02                           rejected (f-type)
   2             0.5  -     -    2.1469e-02  4.5708e-02  9.5274        0.0000e+00 accepted (f-type)
 4 1  1.0000e-02 1    OPT   0    0.9505e-02  1.8894e-02  0.415353      0.0000e+00 accepted (f-type)
 5 1  2.0000e-02 1    OPT   0    3.4922e-02  9.0178e-02                           rejected (f-type)
   2             0.5  -     -    1.7461e-02  1.3918e-02  6.5051        0.0000e+00 accepted (f-type)
 6 1  2.0000e-02 1    OPT   0    9.2873e-03  0.5494e-02  0.451043      0.0000e+00 accepted (f-type)
 7 1  2.0000e-02 1    OPT   0    2.4880e-02  0.7209e-02                           rejected (f-type)
   2             0.5  -     -    1.2440e-02  0.2914e-02  2.26614       0.0000e+00 accepted (f-type)
 8 1  2.0000e-02 1    OPT   0    1.1047e-02  0.0985e-02  1.15467       0.0000e+00 accepted (f-type)
 9 1  2.0000e-02 1    OPT   0    1.0002e-02  0.0232e-02  1.00373       0.0000e+00 accepted (f-type)
10 1  2.0000e-02 1    OPT   0    5.0926e-03  0.0023e-02  0.218984      0.0000e+00 accepted (f-type)
11 1  2.0000e-02 1    OPT   0    2.5324e-03  4.9267e-06  0.0595169     0.0000e+00 accepted (f-type)
12 1  2.8284e-03 1    OPT   0    3.1968e-03  2.8189e-09  0.000831455   0.0000e+00 accepted (f-type)
13 1  1.8449e-06 1    OPT   0    9.7805e-05  8.8817e-16  8.67623e-07   0.0000e+00 accepted (f-type)
14 1  2.5059e-09 1    OPT   0    4.6542e-08  0.0000e+00  2.46136e-13   0.0000e+00 accepted (f-type)
───────────────────────────────────────────────────────────────────────────────────────────────────
@cvanaret cvanaret self-assigned this Oct 28, 2024
@cvanaret
Copy link
Owner

I implemented the first improvement in commit 75cbcb9.
Even though I understand that your last table is more compact (and similar to what IPOPT does), I would argue against it. Abbreviations in the column names create ambiguity and make it difficult to read (although I know what they are!) I'd like it to still be human-readable.
That said, I'm happy to unify on a fixed scientific precision and squeeze some of the wider columns.

@odow
Copy link
Contributor Author

odow commented Oct 30, 2024

My assumptions are:

  • Nearly everyone will ignore the log
  • The people that look at the log are advanced users who know how Uno works under the hood
  • Advanced users will understand abbreviations
  • The log is mostly useful for debugging support questios. People will ask "Why did Uno fail?" and ignore the fact that the log has 2000 iterations and then hits an iteration limit...
  • It's easier to visually grep trends in the log if there is less vertical whitespace
  • I still like 80 character wide terminals...
  • I mostly look at the e+XY, e.g., Is the barrier decreasing by >1 OOM in each iteration at the end? What is the magnitude of the residuals/obj, does it ever go above e+08 or less than e-04. That sort of stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants