PyG
yrwang_xd
详情参见个人主页:https://yrwangxd.github.io/
展开
-
PyTorch Geometric(PyG) Pooling Layers(TopKPooling)简介
class TopKPooling(in_channels, ratio=0.5, min_score=None, multiplier=1, nonlinearity=<built-in method tanh of type object>)参数: in_channels (int) – 输入通道数,也就是x的shape[1].ratio (float) – 池化比率,用来计算 k=⌈ratio⋅N⌉. 如果 min_score 不是 None那么这个值将被忽略. (比率默认: 0原创 2020-05-14 17:39:38 · 3595 阅读 · 0 评论 -
PyTorch Geometric(PyG) Normalization Layers(BatchNorm)源码详解
继承自pytorch的BatchNorm1d,基本没啥变化from torch.nn import BatchNorm1dclass BatchNorm(BatchNorm1d): r"""Applies batch normalization over a batch of node features as described in the `"Batch Normalization: Accelerating Deep Network Training by Reduci原创 2020-05-14 13:41:57 · 669 阅读 · 0 评论 -
PyTorch Geometric(PyG) torch_geometric.nn.conv.gcn_conv源码详解
这个类继承自MessagePassing也就是Convolutional Layersimport torchfrom torch.nn import Parameterfrom torch_scatter import scatter_addfrom torch_geometric.nn.conv import MessagePassingfrom torch_geometric.utils import add_remaining_self_loopsfrom ..inits import原创 2020-05-14 13:20:20 · 4125 阅读 · 1 评论 -
PyTorch Geometric(PyG) Normalization Layers(BatchNorm)简介
class BatchNorm(in_channels, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)参数: in_channels (int) – 输入通道大小.eps (float, optional) – 为分母增加数值的稳定性. (default: 1e-5)momentum (float, optional) – 用于运行平均值和运行方差计算的值. (default: 0.1)affine (bool原创 2020-05-13 16:38:55 · 494 阅读 · 0 评论 -
PyTorch Geometric(PyG) Convolutional Layers(MessagePassing)简介
class MessagePassing(aggr='add', flow='source_to_target', node_dim=0)用于生成message passing层的基类,□表示可微的排列不变性函数,例如 sum,mean或max,以及γΘ 和 ϕΘ表示可区分的功能,例如MLP。参数: aggr (string, optional) – 所用的聚合方法 (“add”, “mean”, “max” or None). (default: “add”)flow (string, op原创 2020-05-13 16:31:03 · 569 阅读 · 0 评论 -
PyTorch Geometric(PyG)环境配置问题解决
如果您在配置最新版PyG时遇到诸如cuda版本与pytorch版本及pyg版本不匹配的问题,在确保各个部分版本已经匹配,但仍有问题时,请用一下配置方案,(该方法为与PyG原作者讨论后得出的)。cuda版本10.0cudnn版本7.6.1以下首先从源码安装了 torch-scatter、 torch-sparse、 torch-cluster、torch-spline-conv 之后安装tor...原创 2020-05-05 18:38:56 · 911 阅读 · 0 评论 -
PyTorch Geometric(PyG)解读、快速开始-简单易懂
PyG官方githubhttps://github.com/rusty1s/pytorch_geometrictorch_geometric.data创建Data对象这个模块包含了一个叫Data的类,可以创建Data对象创建只需要:节点的属性/特征(the attributes/features associated with each node, node features)邻接...原创 2020-04-12 10:46:49 · 6803 阅读 · 11 评论