treeflow.traversal.phylo_likelihood module

treeflow.traversal.phylo_likelihood.move_indices_to_outside(x, start, size)
treeflow.traversal.phylo_likelihood.phylogenetic_likelihood(sequences_onehot: Tensor, transition_probs: Tensor, frequencies: Tensor, postorder_node_indices: Tensor, child_indices: Tensor, batch_shape=())

Per-site phylogenetic likelihood. Assumes all parameters are broadcastable w.r.t. batch shape

sequences_onehot

Tensor with shape […, leaf, state]

transition_probs

Tensor with shape […, node, state, state] Must be broadcasted over sites

frequencies

Tensor with shape […, state]

postorder_node_indices

Tensor with shape [internal_node]. Cannot have batch dimensions.

child_indices

Tensor with shape [internal_node, children]