pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.23k stars 3.64k forks source link

How can I use Xconv to perform deconvolution. #821

Open divyanshj16 opened 4 years ago

divyanshj16 commented 4 years ago

❓ Questions & Help

Question 1.

In the paper it says, the conv and deconv are same operations in pointcnn. image However, I cannot make it to work. In the forward of Xconv. image I tried passing the features from the latest layer in x and pos, batch from the layer I want to deconv to. Currently I am using (knn_interpolate + xconv) inplace of deconv using xconv. How can I make it work the proper way?

Question 2.

image The image shows that the input will have 2048 point and after applying Xconv the num_points decrease to 768. But I have seen that the number of points stay same after XConv operation In your pointcnn test files you have explicitly used a fps downsampling method to do that. Can you please clarify?

rusty1s commented 4 years ago

Can you show me a minimal example to reproduce this? XConv shouldn't change the number of nodes. Are you sure that all inputs (x, pos, and batch) share the same number of nodes?

divyanshj16 commented 4 years ago

You are right.

I tried passing the features from the latest layer in x and pos, batch from the layer I want to deconv to.

This is throws error.

The way I am changing the number of nodes is (knn_interpolate + Xconv)

divyanshj16 commented 4 years ago

Here in: https://github.com/yangyanli/PointCNN/blob/master/pointcnn_seg/s3dis_x8_2048_fps.py There are deconv parameters. image

After going at this line in this file, I saw that the deconv parameters are also passed to the XConv in some way.

@rusty1s Are you looking into this?

divyanshj16 commented 4 years ago

Can you confirm if the torch_geometric implementation of xconv conforms with the architecture described in the paper?

rusty1s commented 4 years ago

The XConv should work as the architecture described in the paper, but it does not automatically reduce or increase the point size. You need to do this manually.

divyanshj16 commented 4 years ago

Okay. Thanks for your help.

rusty1s commented 4 years ago

Nonetheless, it should be possible to include this to our current XConv module (similar to the PointConv module which is able to operate on bipartite graphs). I label this as a feature request :)

divyanshj16 commented 4 years ago

I would like to contribute to it. Can you help figuring me out where exactly to put this?

rusty1s commented 4 years ago

Sure, and thank your very much :) Do you know about the bipartite message passing API used in PointConv? Here, we have two sets of nodes that exchange messages, and that is why pos is getting passed as a tuple with two entries. Semantically, this means that the first entry passes its messages to the second entry as described by edge_index. For providing the XConv operator with this functionality, this means that the knn computation should be deployed on two different points sets (pos[0] and pos[1]). Therefore, you should use the knn method instead of knn_graph to achieve this. Feel free to ask any questions if my explanations are not clear :)

anewlearner commented 4 years ago

Is there any update?