最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pytorch - Graph Neural Network Pooling for keeping the same shape of node without batching - Stack Overflow

programmeradmin0浏览0评论

I want to add a pooling layer on my model. I want to preserve the num of node as I m doing node prediction without batching.

import torch
from torch_geometric.nn import global_add_pool
# Assume your input tensor is x with shape (num_nodes, num_node_features)
x = torch.randn(10, 10)  # Example tensor with (num_nodes, num_node_features) = (10, 10)
# Apply global_add_pool
x_pooled = global_add_pool(x, batch=None)

x_pooled (1,10) But I want a pooling method to give me (10,x)

发布评论

评论列表(0)

  1. 暂无评论