pytorch-tree-lstm
pytorch-tree-lstm copied to clipboard
Num edges = Num nodes - 1
Every node in tree has one and only one parent, except for root node (that doesn't have a parent). This is means that E = N - 1 E: number of edges in tree N: number of nodes in tree
=> tree_size can be computed from shape[0] of adjacency matrix
argument tree_size
in calculate_evaluation_orders
func can be removed as:
tree_size = len(adjacency_list) + 1