Commit eeafcb14 authored by Ruben Wiersma's avatar Ruben Wiersma

Fix for latest PyTorch Geometric

parent 3d67d1eb
......@@ -13,10 +13,9 @@ Code for Harmonic Surface Networks, an approach for deep learning on surfaces op
## Dependencies
This project requires the following dependencies. The version numbers have been tested and shown to work, other versions are likely, but not guaranteed, to work.
- [PyTorch 1.5](https://pytorch.org)
- [PyTorch Geometric 1.4.3 and its dependencies](https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html)
<br />There are known issues with some later versions of PyTorch geometric (specifically, 1.6.1). Our code has been tested with version 1.4.3. To install, follow the [instructions](https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html) and in the last step, type:
<br />`$ pip install torch-geometric==1.4.3`
- [PyTorch >= 1.5](https://pytorch.org)
- [PyTorch Geometric and its dependencies](https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html)
<br />The version used in the experiments is PyTorch Geometric 1.4.3
- [Progressbar2](https://pypi.org/project/progressbar2/)
- [Suitesparse](http://faculty.cse.tamu.edu/davis/suitesparse.html) (used for the Vector Heat Method)
......
......@@ -29,7 +29,7 @@ class HarmonicConv(MessagePassing):
"""
def __init__(self, in_channels, out_channels, max_order=1, n_rings=2, prev_order=1,
offset=True, separate_streams=True):
super(HarmonicConv, self).__init__(aggr='add', flow='target_to_source')
super(HarmonicConv, self).__init__(aggr='add', flow='target_to_source', node_dim=0)
self.in_channels = in_channels
self.out_channels = out_channels
......
......@@ -18,7 +18,7 @@ class ParallelTransportPool(MessagePassing):
transform (obj): transform to apply to the pooled data
"""
def __init__(self, lvl, transform=None):
super(ParallelTransportPool, self).__init__(aggr='mean', flow='target_to_source')
super(ParallelTransportPool, self).__init__(aggr='mean', flow='target_to_source', node_dim=0)
self.lvl = lvl
self.scale_mask = ScaleMask(lvl, True)
self.transform = transform
......
......@@ -68,7 +68,7 @@ class HarmonicPrecomp(object):
# Set kernel for center points to 0
# Why this is necessary: for the center point, r = 0 and theta = 0
# Thus, the kernel value will always be 1 + i0, pointing to the - arbitrary - choice of basis
exponential[torch.nonzero(r == 0)] = 0
exponential[torch.nonzero(r == 0), :1] = 0
# Finally, normalize weighting for every neighborhood and multiply with precomputation
weight = weight / (1e-12 + scatter_add(weight, row)[row]) # [N]
......
......@@ -14,7 +14,7 @@ def mask_idx(lvl, edge_mask):
:param lvl: the desired scale lvl.
:param edge_mask: a multi-scale edge mask.
"""
mask = torch.nonzero(edge_mask & (0b1 << lvl)).flatten()
mask = torch.nonzero(edge_mask & (0b1 << lvl), as_tuple=False).flatten()
return mask
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment