-
Notifications
You must be signed in to change notification settings - Fork 7
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
Pretty printing of Turing models #91
Comments
This is how @torfjelde is there a way to get the underlying model of an instantiated |
What do you mean by this? As in, what information are hoping to extract? As you say, it's just a As for the pretty-printing, I agree we should do something. I'll make an issue over at DPPL. |
The underlying macro call. @model function demo(x, y)
# Assumptions
σ2 ~ InverseGamma(2, 3)
σ = sqrt(σ2)
μ ~ Normal(0, σ)
# Observations
x ~ Normal(μ, σ)
y ~ Normal(μ, σ)
end |
That's not possible, but why would you want that? Sorry, maybe I'm not
fully understanding.
…On Fri, May 26, 2023, 9:24 AM Jose Storopoli ***@***.***> wrote:
What do you mean by this?
The underlying macro call.
Like:
@model function demo(x, y)
# Assumptions
σ2 ~ InverseGamma(2, 3)
σ = sqrt(σ2)
μ ~ Normal(0, σ)
# Observations
x ~ Normal(μ, σ)
y ~ Normal(μ, σ)end
—
Reply to this email directly, view it on GitHub
<#91 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPZZAKFIFSIRCL44TBI6DXIBSEJANCNFSM6AAAAAAYH4KPGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
They want to have the model macro when they create a model using |
Gotcha. That would have to be provided by TuringGLM if so. A macro generates code, so once you apply a macro, e.g. |
Yeah, but I don't want any scaffolding on Turing from TuringGLM. That would need a TuringGLM custom type to hold that as a field (maybe a |
My rationale for this was two-fold:
|
I don't have the time to pursue this right now, but you could do something like this: struct TuringGLMModel{M,F,P}
model::M
formula::F
priors::P
# other stuff
# ...
end and then just display this in a different way than what you would for typical Turing.jl models. |
I am trying to use TuringGLM to better learn Turing, and so I wrote the simplest LM and would like to re-write that in Turing.
Unfortunately, I can't get my head around this output to format in a standard Turing syntax. Is there a way to "pretty-print" or format the Turing model call? Thanks!
The text was updated successfully, but these errors were encountered: