This is a PyTorch implementation of the spline-based convolution operator of SplineCNN, as described in our paper:
pip install'urllib3==1.26.14'
pip install pytest
Matthias Fey, Jan Eric Lenssen, Frank Weichert, Heinrich Müller: [SplineCNN: Fast Geometric Deep Learning with Continuous B-Spline Kernels](https://arxiv.org/abs/1711.08920)(CVPR 2018)
pip insta;; wheel
```
The operator works on all floating point data types and is implemented both for CPU and GPU.
***x***(Tensor)* - Input node features of shape `(number_of_nodes x in_channels)`.
***edge_index***(LongTensor)* - Graph edges, given by source and target indices, of shape `(2 x number_of_edges)`.
***pseudo***(Tensor)* - Edge attributes, ie. pseudo coordinates, of shape `(number_of_edges x number_of_edge_attributes)` in the fixed interval [0, 1].
***weight***(Tensor)* - Trainable weight parameters of shape `(kernel_size x in_channels x out_channels)`.
***kernel_size***(LongTensor)* - Number of trainable weight parameters in each edge dimension.
***is_open_spline***(ByteTensor)* - Whether to use open or closed B-spline bases for each dimension.
***norm***(bool, optional)*: Whether to normalize output by node degree. (default: `True`)
***root_weight***(Tensor, optional)* - Additional shared trainable parameters for each feature of the root node of shape `(in_channels x out_channels)`. (default: `None`)
***bias***(Tensor, optional)* - Optional bias of shape `(out_channels)`. (default: `None`)
### Returns
***out***(Tensor)* - Out node features of shape `(number_of_nodes x out_channels)`.
### Example
```python
importtorch
fromtorch_spline_convimportspline_conv
x=torch.rand((4,2),dtype=torch.float)# 4 nodes with 2 features each
This is a PyTorch implementation of the spline-based convolution operator of SplineCNN, as described in our paper:
Matthias Fey, Jan Eric Lenssen, Frank Weichert, Heinrich Müller: [SplineCNN: Fast Geometric Deep Learning with Continuous B-Spline Kernels](https://arxiv.org/abs/1711.08920)(CVPR 2018)
The operator works on all floating point data types and is implemented both for CPU and GPU.
## Installation
### Binaries
We provide pip wheels for all major OS/PyTorch/CUDA combinations, see [here](https://pytorch-geometric.com/whl).
#### PyTorch 1.7.0
To install the binaries for PyTorch 1.7.0, simply run
***x***(Tensor)* - Input node features of shape `(number_of_nodes x in_channels)`.
***edge_index***(LongTensor)* - Graph edges, given by source and target indices, of shape `(2 x number_of_edges)`.
***pseudo***(Tensor)* - Edge attributes, ie. pseudo coordinates, of shape `(number_of_edges x number_of_edge_attributes)` in the fixed interval [0, 1].
***weight***(Tensor)* - Trainable weight parameters of shape `(kernel_size x in_channels x out_channels)`.
***kernel_size***(LongTensor)* - Number of trainable weight parameters in each edge dimension.
***is_open_spline***(ByteTensor)* - Whether to use open or closed B-spline bases for each dimension.
***norm***(bool, optional)*: Whether to normalize output by node degree. (default: `True`)
***root_weight***(Tensor, optional)* - Additional shared trainable parameters for each feature of the root node of shape `(in_channels x out_channels)`. (default: `None`)
***bias***(Tensor, optional)* - Optional bias of shape `(out_channels)`. (default: `None`)
### Returns
***out***(Tensor)* - Out node features of shape `(number_of_nodes x out_channels)`.
### Example
```python
importtorch
fromtorch_spline_convimportspline_conv
x=torch.rand((4,2),dtype=torch.float)# 4 nodes with 2 features each