Closed GianmarcoCallegher closed 1 year ago
import liesel.model as lsl
import tensorflow_probability.substrates.jax.distributions as tfd
import jax.numpy as jnp
n0 = lsl.Param(1.0, None, 'n0')
n1 = lsl.Var(2.0, None, 'n1')
n2 = lsl.Var(lsl.Calc(jnp.exp, n1), None, 'n2')
n0.dist_node = lsl.Dist(tfd.HalfNormal, scale=n2)
gb = lsl.GraphBuilder()
gb.add(n0, n1, n2)
model = gb.build_model()
lsl.plot_vars(model)
It can be something like that. I'm not a huge fan of the solution.
Do we want to do that only for plot_vars
?
I'm not sure whether I correctly understand what the purpose is. Is this interpretation correct?
Arrows that represent input to a variable's distribution are colored in light grey now, to create a visual distinction from arrows that represent input to a variable's calculator. The latter are colored in black, like they used to be.
I'm not sure whether I correctly understand what the purpose is. Is this interpretation correct?
Arrows that represent input to a variable's distribution are colored in light grey now, to create a visual distinction from arrows that represent input to a variable's calculator. The latter are colored in black, like they used to be.
Yes
Thanks! Maybe then a legend entry for both cases would be nice, something like "black: Used in value", "grey: Used in distribution". What do you think?
Thanks! Maybe then a legend entry for both cases would be nice, something like "black: Used in value", "grey: Used in distribution". What do you think?
Sure
You can check now
I like it. One additional question: Why do you write "Used in value or calculator"? Can an input node be used in another node's value without the use of a calculator?
I like it. One additional question: Why do you write "Used in value or calculator"? Can an input node be used in another node's value without the use of a calculator?
You are right, it's redundant. I fixed it
I would like to see what the result looks like ;)