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

Anonymous variables should always force create #103

Closed
wouterwln opened this issue Aug 9, 2023 · 1 comment
Closed

Anonymous variables should always force create #103

wouterwln opened this issue Aug 9, 2023 · 1 comment
Assignees

Comments

@wouterwln
Copy link
Member

No description provided.

@wouterwln wouterwln self-assigned this Aug 9, 2023
@bvdmitri
Copy link
Member

bvdmitri commented Aug 9, 2023

@model function ssm(n, y)
    x_0 ~ Normal(μ = 0, σ = 1.0)
    
    x_prev = x_0
    
    local x
    for i in 1:n
        x[i] ~ Normal(μ = x_prev + 1, σ = 1.0)
        x_prev = x[i]
    end
    
    y ~ Normal(μ = x[end], σ = 1.0)
end

n = 3
model = GraphPPL.create_model()
ctx = GraphPPL.getcontext(model)

y = GraphPPL.getorcreate!(model, ctx, :y, nothing);

GraphPPL.make_node!(model, ctx, ssm, y, (n = n, ), )

GraphPlot.gplot(model)

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

When branches are created from issues, their pull requests are automatically linked.

2 participants