in src/lic/ppl/world/world.py [0:0]
def compute_score(self, node_var: Variable) -> Tensor:
"""
Computes the score of the node plus its children
:param node_var: the node variable whose score we are going to compute
:returns: the computed score
"""
score = node_var.log_prob.clone()
for child in node_var.children:
if child is None:
raise ValueError(f"node {child} is not in the world")
# We just need to read the node in the latest diff.
child_var = self.get_node_in_world_raise_error(child, False)
score += child_var.log_prob.clone()
score += node_var.jacobian
return score