TreeFilter-Torch icon indicating copy to clipboard operation
TreeFilter-Torch copied to clipboard

Some questions about the code and equations in paper

Open zhujiagang opened this issue 5 years ago • 2 comments
trafficstars

An excellent work! I've several questions.

  1. 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
  2. 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
  3. 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

zhujiagang avatar Oct 24 '20 08:10 zhujiagang

Thanks for your interest in our work.

  1. Because out_data is ordered as the input feature, but out_grad is ordered in the breadth-first-search (BFS) manner.
  2. 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
  3. 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.

StevenGrove avatar Oct 26 '20 03:10 StevenGrove

Got It! Thank you very much!

zhujiagang avatar Oct 28 '20 13:10 zhujiagang