Description: GCNConv is a graph convolutional neural network layer implemented in the torch_geometric library. reset_parameters is a method that sets the learnable parameters of the GCNConv layer to random initial values.
Code Examples:
# Import necessary libraries import torch from torch_geometric.nn import GCNConv
# Create a GCNConv layer layer = GCNConv(in_channels=16, out_channels=32)
# Reset the layer parameters layer.reset_parameters()
# Create a random input tensor x = torch.randn((32, 16))
# Pass the input tensor through the GCNConv layer output = layer(x)
# Print the output tensor shape print(output.shape)
In this example, we create a GCNConv layer with 16 input channels and 32 output channels. We then reset the layer parameters to random initial values using the reset_parameters method. We create a random input tensor with 32 samples and 16 features, and pass it through the GCNConv layer. Finally, we print the shape of the output tensor.
Package Library: torch_geometric
Python GCNConv.reset_parameters - 30 examples found. These are the top rated real world Python examples of torch_geometric.nn.GCNConv.reset_parameters extracted from open source projects. You can rate examples to help us improve the quality of examples.