-
Notifications
You must be signed in to change notification settings - Fork 37
Add shorter non-display printing of VarInfo #66
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
Conversation
|
Maybe just print the number of variables and possibly the log probability in the short version? |
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
==========================================
- Coverage 79.42% 76.43% -3.00%
==========================================
Files 13 13
Lines 841 853 +12
==========================================
- Hits 668 652 -16
- Misses 173 201 +28
Continue to review full report at Codecov.
|
|
|
|
Yes, something like this. I guess that should be the most important information, shouldn't it? But maybe it's still to verbose? |
|
For me everything that short is fine -- it shouldn't clutter printing of nested structures. I'll leave this open some time to wait for feedback. |
Maybe add:
|
|
Hmm I'm not sure, the intention here is to have a really short condensed way of printing a |
|
I concur with David, although I think that adding the variables names is not a bad idea. |
|
I see David's point, but model dimensionality is something valuable and can be packed into a few words. |
|
@yebai What exactly do you mean by that? The sum of the sizes of all variables? Is this currently used anywhere in the |
|
Yes, exactly. |
|
What about this: VarInfo (λ (size 1), m (size 1); logp: -3.612)where |
|
Looks good, maybe reformat the dimensionality message Also, this might gets messy when we have a lot of parameters. That's where a single model dimensionality might be less verbose. |
|
Ok, I tried to extract the size: function _vname_info(vn, vi)
md = vi.metadata
s = size(md.vals[md.ranges[md.idcs[vn]]])
if s == ()
return "$(getsym(vn))"
else
return "$(getsym(vn)) $s"
end
endBut since the values are only given through ranges, there seems to be no way to distinguish scalars from size 1 vectors? E.g. for a Or is there? |
That works. |
No, AFAIK one can only distinguish between scalars and vectors with one element by checking if the corresponding distribution is uni- or multivariate. IMO that's one of the inconveniences caused by vectorizing everything in |
|
Ok, based on this feedback I think it's best to show just the overall dimension of the model, plus a limited number of symbols of variable names (given by a constant The current way of implementating this does not distinguish between one |
|
This looks nice. To distinguish parameters and data, maybe group them and annotate using a semicolon, e.g. where |
|
But the observed data is not contained in the |
|
No, I think you're right, it's not available (and hence probably should not be printed?). |
Hmm, I didn't release this - sorry for the noise. We might want to store the observed variable information in |
Currently, a
VarInfoprints to a huge blob showing all kinds of stuff. Which is useful on its own in the REPL, but not as part of another printed structure.I moved that version to
show(::IO, ::MIME"text/plain", ::UntypedVarInfo), and added a dummy replacementPlease suggest what things should actually printed in the short version.