A neural decision tree model has two sets of weights to learn. The first set is pi, which represents the probability distribution of the classes in the tree leaves. The second set is the weights of the routing layer decision_fn, which represents the probability of going to each leave. The forward pass of the model works as follows: