pytorch-tree-lstm icon indicating copy to clipboard operation
pytorch-tree-lstm copied to clipboard

Seems like the node labeling does not guarantee one-to-one mapping

Open Hacker0912 opened this issue 6 years ago • 2 comments

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.

Hacker0912 avatar Nov 23 '19 20:11 Hacker0912

I have raised a similar issue before seeing your raised issue.

shravansingh123 avatar Dec 19 '19 08:12 shravansingh123

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.

shravansingh123 avatar Dec 19 '19 09:12 shravansingh123