About max_pool
#2641
-
Hi Matt, I have some questions about the code below. def forward(self, data):
data.x = F.elu(self.conv1(data.x, data.edge_index, data.edge_attr))
weight = normalized_cut_2d(data.edge_index, data.pos)
cluster = graclus(data.edge_index, weight, data.x.size(0))
data.edge_attr = None
data = max_pool(cluster, data, transform=transform)
data.x = F.elu(self.conv2(data.x, data.edge_index, data.edge_attr))
weight = normalized_cut_2d(data.edge_index, data.pos)
cluster = graclus(data.edge_index, weight, data.x.size(0))
x, batch = max_pool_x(cluster, data.x, data.batch)
x = global_mean_pool(x, batch)
x = F.elu(self.fc1(x))
x = F.dropout(x, training=self.training)
return F.log_softmax(self.fc2(x), dim=1)
|
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
May 27, 2021
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hkim716
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
max_pool
will pool a givendata
object, i.e., it will take care of coarsening the graph and pool node features, whilemax_pool_x
will only take care of pooling node features (e.g., in caseedge_index
is no longer needed at this point of time).