Commit 1b4d789c authored by rusty1s's avatar rusty1s
Browse files

typos

parent c5e4adac
...@@ -48,8 +48,8 @@ The kernel function *g* is defined over the weighted B-spline tensor product bas ...@@ -48,8 +48,8 @@ The kernel function *g* is defined over the weighted B-spline tensor product bas
### Parameters ### Parameters
* **src** *(Tensor or Variable)* - Input node features of shape `(number_of_nodes x in_channels)` * **src** *(Tensor or Variable)* - Input node features of shape `(number_of_nodes x in_channels)`
* **edge_idex** *(LongTensor)* - Graph edges, given by source and target indices, of shape `(2 x number_of_edges)` * **edge_index** *(LongTensor)* - Graph edges, given by source and target indices, of shape `(2 x number_of_edges)`
* **pseudo** *(Tensor or Variable)* - Edge attributes, ie. pseudo coordinates, of shape `(number_of_edges x number_of_edge_attributes)` * **pseudo** *(Tensor or Variable)* - Edge attributes, ie. pseudo coordinates, of shape `(number_of_edges x number_of_edge_attributes)` in the fixed interval [0, 1]
* **weight** *(Tensor or Variable)* - Trainable weight parameters of shape `(kernel_size x in_channels x out_channels)` * **weight** *(Tensor or Variable)* - 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 * **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 * **is_open_spline** *(ByteTensor)* - Whether to use open or closed B-spline bases for each dimension
...@@ -65,16 +65,16 @@ from torch_spline_conv import spline_conv ...@@ -65,16 +65,16 @@ from torch_spline_conv import spline_conv
src = torch.Tensor(4, 2) # 4 nodes with 2 features src = torch.Tensor(4, 2) # 4 nodes with 2 features
edge_index = torch.LongTensor([[0, 1, 1, 2, 2, 3], [1, 0, 2, 1, 3, 2]]) # 6 edges edge_index = torch.LongTensor([[0, 1, 1, 2, 2, 3], [1, 0, 2, 1, 3, 2]]) # 6 edges
pseudo = torch.Tensor(6, 2) # 2-dimensional edge attributes, restricted to [0, 1] pseudo = torch.Tensor(6, 2) # two-dimensional edge attributes
weight = torch.Tensor(25, 2, 4) # 25 trainable parameters for each in_channels x out_channels combination weight = torch.Tensor(25, 2, 4) # 25 trainable parameters for each in_channels x out_channels combination
kernel_size = torch.LongTensor([5, 5]) # 5 trainable parameters in each edge dimension kernel_size = torch.LongTensor([5, 5]) # 5 trainable parameters in each edge dimension
is_open_spline = torch.ByteTensor([1, 1]) # Both B-spline bases should be open is_open_spline = torch.ByteTensor([1, 1]) # only use open B-splines
degree = 1 # B-spline degree of 1 (implemented: 1, 2, 3) degree = 1 # B-spline degree of 1
root_weight = torch.Tensor(2, 4) # Weight root nodes in addition root_weight = torch.Tensor(2, 4) # Weight root nodes separatly
bias = torch.Tensor(4) # Add bias bias = None # No additional bias
output = spline_conv(src, edge_index, pseudo, weight, kernel_size, output = spline_conv(src, edge_index, pseudo, weight, kernel_size,
is_open_spline, degree=1, root_weight=None, bias=None) is_open_spline, degree, root_weight, bias)
print(output.size()) print(output.size())
torch.Size([4, 4]) # 4 nodes with 4 features torch.Size([4, 4]) # 4 nodes with 4 features
......
...@@ -26,8 +26,9 @@ def spline_conv(src, ...@@ -26,8 +26,9 @@ def spline_conv(src,
Args: Args:
src (Tensor or Variable): Input node features of shape src (Tensor or Variable): Input node features of shape
(number_of_nodes x in_channels) (number_of_nodes x in_channels)
edge_idex (LongTensor): Graph edges, given by source and target edge_index (LongTensor): Graph edges, given by source and target
indices, of shape (2 x number_of_edges) indices, of shape (2 x number_of_edges) in the fixed interval
[0, 1]
pseudo (Tensor or Variable): Edge attributes, ie. pseudo coordinates, pseudo (Tensor or Variable): Edge attributes, ie. pseudo coordinates,
of shape (number_of_edges x number_of_edge_attributes) of shape (number_of_edges x number_of_edge_attributes)
weight (Tensor or Variable): Trainable weight parameters of shape weight (Tensor or Variable): Trainable weight parameters of shape
......
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