TreeFilter-Torch
TreeFilter-Torch copied to clipboard
Some questions about the code and equations in paper
trafficstars
An excellent work! I've several questions.
- Why does the par appear in out_grad, while par_pos in out_data? https://github.com/Megvii-BaseDetection/TreeFilter-Torch/blob/4eed6b61f0f8688618a8563b98a1f21a5c1f9440/furnace/kernels/lib_tree_filter/src/refine/refine.cu#L184
- delta S(Ei,j)/delta wi,j in eq.9 seems to disappear in the code. https://github.com/Megvii-BaseDetection/TreeFilter-Torch/blob/4eed6b61f0f8688618a8563b98a1f21a5c1f9440/furnace/kernels/lib_tree_filter/src/refine/refine.cu#L367
- The paper says "uniformly sample a vertex as the root and perform breadth-first sorting (BFS) algorithm to obtain the topological order of tree G“. But it seems that the code always start from the index 0. https://github.com/Megvii-BaseDetection/TreeFilter-Torch/blob/4eed6b61f0f8688618a8563b98a1f21a5c1f9440/furnace/kernels/lib_tree_filter/src/bfs/bfs.cu#L79
Thanks for your interest in our work.
- Because out_data is ordered as the input feature, but out_grad is ordered in the breadth-first-search (BFS) manner.
- The "weight" in "refine.cu" is already calculated by S(Ei, j), whose gradient is obtained by using the native PyTorch code. Please refer to the distance_func https://github.com/Megvii-BaseDetection/TreeFilter-Torch/blob/4eed6b61f0f8688618a8563b98a1f21a5c1f9440/furnace/kernels/lib_tree_filter/modules/tree_filter.py#L29
- In the BFS algorithm, different vertexes as the root, the algorithm will output a consistent topology. For convenience, we choose the first vertex as the root.
Got It! Thank you very much!