Find answers from the community

Updated last year

Hey Team I have 20 nodes and I built a

Hey Team, I have 20 nodes and I built a tree_index with num_children = 4, assuming I would 5 summary root nodes . However when I run tree_index.index_struct.root_nodes I only get 2 nodes? Was one extra level added to the tree? Almost seems like its ignoring my num_children argument
J
L
6 comments
in another case, I built a tree index with default argument, 56 nodes and it gave me 6 root nodes to synthesize - which included all info.
Looking at my index, there are 20 children, 6 parents, then 2 root nodes. How can I grab the 6 parents?
ngl, I have zero idea how the tree index works. Would have to read the source code for this one
Did some chatgpting on this and found it:

Plain Text
 Hypothetical Scenario:
Let's say you have 20 nodes and self.num_children is set to 4.

Your 20 nodes will be divided into 5 chunks (each with 4 nodes).
Each chunk will create a new parent node, so you'll have 5 new nodes.
If self.num_children is still 4, you will divide these 5 into chunks of size 4, leaving one chunk of size 1 (or another number smaller than 4).
The recursive function might result in 2 new nodes: one summarizing 4 nodes, and the other summarizing the remaining 1 node.

Guess through deduction that is how it should work based on current code but didnt expect that.
Changing to 5 children made it work. 4 root nodes as expected. Full convo linked above.
Add a reply
Sign up and join the conversation on Discord