You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to add an ipython notebook to demonstrate the new flexible interface of the new torch_geometric.nn.aggr package with MessagePassing. In the new integration, the following functionality is applicable:
# Original interface with string type as aggregation argumentclassMyConv(MessagePassing):
def__init__(self):
super().__init__(aggr="mean")
# Use a single aggregation module as aggregation argumentclassMyConv(MessagePassing):
def__init__(self):
super().__init__(aggr=MeanAggregation())
# Use a list of aggregation strings as aggregation argumentclassMyConv(MessagePassing):
def__init__(self):
super().__init__(aggr=['mean', 'max', 'sum', 'std', 'var'])
# Use a list of aggregation modules as aggregation argumentclassMyConv(MessagePassing):
def__init__(self):
super().__init__(aggr=[
MeanAggregation(),
MaxAggregation(),
SumAggregation(),
StdAggregation(),
VarAggregation(),
])
# Use a list of mixed modules and strings as aggregation argumentclassMyConv(MessagePassing):
def__init__(self):
super().__init__(aggr=[
'mean',
MaxAggregation(),
'sum',
StdAggregation(),
'var',
])
# Define multiple learnable aggregations with keyword argumentsclassMyConv(MessagePassing):
def__init__(self):
super().__init__(aggr=['softmax', 'softmax', 'softmax'],
aggr_kwargs=dict(aggrs_kwargs=[
dict(t=0.1, learn=True),
dict(t=1, learn=True),
dict(t=10, learn=True)]))
# Define multiple aggregations with `MultiAggregation` moduleclassMyConv(MessagePassing):
def__init__(self):
super().__init__(aggr=MultiAggregation([
SoftmaxAggregation(t=0.1, learn=True),
SoftmaxAggregation(t=1, learn=True),
SoftmaxAggregation(t=10, learn=True)]))
The text was updated successfully, but these errors were encountered:
lightaime
changed the title
Add an iPython notebook tutorial to introduce the new torch_geometric.nn.aggr package
Add an ipython notebook tutorial to introduce the new torch_geometric.nn.aggr package
Jul 5, 2022
🚀 The feature, motivation and pitch
We would like to add an ipython notebook to demonstrate the new flexible interface of the new
torch_geometric.nn.aggr
package withMessagePassing
. In the new integration, the following functionality is applicable:The text was updated successfully, but these errors were encountered: