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
I found it useful to visualize the circuit in programming. Below is a naive print function for probabilistic circuits, but we can do better with julia graph visualization tools : )
functionprint_circuit_dfs(node::ProbΔNode, tab=0, weight=0)
for i =1: tab
print("> ")
endif node isa ProbLiteral
print("Literal ", lit2var(literal(node)), "", positive(node), "")
if weight >0print("(", weight, ")")
endprint("\n")
elseif node isa Prob⋀
print("AND ")
if weight >0print("(", weight, ")")
endprint("\n")
for i in1:length(node.children)
print_circuit_dfs(node.children[i], tab +1)
endelseif node isa Prob⋁
print("OR ")
if weight >0print("(", weight, ")")
endprint("\n")
p_thetas = [exp(node.log_thetas[i]) for i in1:length(node.children)]
for i in1:length(node.children)
print_circuit_dfs(node.children[i], tab +1, p_thetas[i])
endelseprintln("ERROR ", node)
endend
The text was updated successfully, but these errors were encountered:
I found it useful to visualize the circuit in programming. Below is a naive print function for probabilistic circuits, but we can do better with julia graph visualization tools : )
The text was updated successfully, but these errors were encountered: