You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently GraphPPL.jl allows for nesting linear operations, i.e. y ~ x1 + x2 + x3 * x4 , something which in my opinion is very cool and partly solves a remark in the above issue. Next up would be to also implement the sum() operation. I think we can get away with using it as an alias depending on its inputs:
# defaults to a + b + c + d (if independent)
y ~sum(a, b, c, d)
y ~sum([a, b, c, d])
# defaults to dot(a_array, ones(..)) (if dependent)
y ~sum(a_array)
y ~sum(a_array[1], a_array[2], ...)
y ~sum([a_array[1], a_array[2], ...])
# more complicated structures can be unrolled
y ~sum(a_array[1], a_array[2], b) # here y ~ sum(a_array[1], a_array[2]) + b
The text was updated successfully, but these errors were encountered:
I'll mark this as closed now, for two reasons. In the following code snippet:
@model function sum_test(out, x, y)
τ := sum([1,2,3,4])
σ := sum(ones(4))
out := sum(x, y)
end
τ and σ will both be variables with value 10 and 4 respectively, and for out a sum node will be created if either (or both) x or y is a random variable. This is, as far as I know, everything we can do in this regard. Your last example will sadly not work. We know that sum is a commutative operation, however we do not have this guarantee in general, therefore we will always materialize this sum node if either a_array[1], a_array_2 or b is a random variable. I don't feel like having a trait based system that labels commutative operations is in the scope of GraphPPL.
Following ReactiveBayes/RxInfer.jl#60:
Currently
GraphPPL.jl
allows for nesting linear operations, i.e.y ~ x1 + x2 + x3 * x4
, something which in my opinion is very cool and partly solves a remark in the above issue. Next up would be to also implement thesum()
operation. I think we can get away with using it as an alias depending on its inputs:The text was updated successfully, but these errors were encountered: