pytorch-tree-lstm
pytorch-tree-lstm copied to clipboard
Seems like the node labeling does not guarantee one-to-one mapping
Hi,
I find this optimized version of tree-lstm interesting and I have took a loot at the code. It seems that the method “_label_node_index” does not guarantee one-to-one mapping when assigning label/index to each node of the tree - the labelling is done in the depth-first-search fashion and in Python, the variable "n" (representing the global index) will not be updated globally during recursive-calls that are independent of each other (e.g., _label_node_index called on different children). But I can understand it if this function is particularly implemented for the toy example given.
I have raised a similar issue before seeing your raised issue.
Hi, Can you please look at this issue(https://github.com/unbounce/pytorch-tree-lstm/issues/13) . In case you tumbled upon this same problem.