首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么会有多个输入层?GraphSAGE

为什么会有多个输入层?GraphSAGE
EN

Stack Overflow用户
提问于 2019-10-23 13:20:34
回答 1查看 111关注 0票数 0

我刚接触CNN和tutorials of GraphSAGE。我运行了GraphSAGE Cora节点分类示例graphsage-cora-example.py。本文的任务是对cora数据集的节点标签进行分类。

当您运行此代码时,您将获得以下模型摘要:

代码语言:javascript
复制
Layer (type)                    Output Shape         Param # 

    Connected to                     
==================================================================================================
input_2 (InputLayer)            [(None, 20, 1433)]   0                                            
__________________________________________________________________________________________________
input_3 (InputLayer)            [(None, 200, 1433)]  0                                            
__________________________________________________________________________________________________
input_1 (InputLayer)            [(None, 1, 1433)]    0                                            
__________________________________________________________________________________________________
reshape (Reshape)               (None, 1, 20, 1433)  0           input_2[0][0]                    
__________________________________________________________________________________________________
reshape_1 (Reshape)             (None, 20, 10, 1433) 0           input_3[0][0]                    
__________________________________________________________________________________________________
dropout_1 (Dropout)             (None, 1, 1433)      0           input_1[0][0]                    
__________________________________________________________________________________________________
dropout (Dropout)               (None, 1, 20, 1433)  0           reshape[0][0]                    
__________________________________________________________________________________________________
dropout_3 (Dropout)             (None, 20, 1433)     0           input_2[0][0]                    
__________________________________________________________________________________________________
dropout_2 (Dropout)             (None, 20, 10, 1433) 0           reshape_1[0][0]                  
__________________________________________________________________________________________________
mean_aggregator (MeanAggregator multiple             28680       dropout_1[0][0]                  
                                                                 dropout[0][0]                    
                                                                 dropout_3[0][0]                  
                                                                 dropout_2[0][0]                  
__________________________________________________________________________________________________
reshape_2 (Reshape)             (None, 1, 20, 20)    0           mean_aggregator[1][0]            
__________________________________________________________________________________________________
dropout_5 (Dropout)             (None, 1, 20)        0           mean_aggregator[0][0]            
__________________________________________________________________________________________________
dropout_4 (Dropout)             (None, 1, 20, 20)    0           reshape_2[0][0]                  
__________________________________________________________________________________________________
mean_aggregator_1 (MeanAggregat (None, 1, 20)        420         dropout_5[0][0]                  
                                                                 dropout_4[0][0]                  
__________________________________________________________________________________________________
reshape_3 (Reshape)             (None, 20)           0           mean_aggregator_1[0][0]          
__________________________________________________________________________________________________
lambda (Lambda)                 (None, 20)           0           reshape_3[0][0]                  
__________________________________________________________________________________________________
dense (Dense)                   (None, 7)            147         lambda[0][0]                     
==================================================================================================
Total params: 29,247
Trainable params: 29,247
Non-trainable params: 0

为什么会有多个输入层?这些输出形状的数量表明了什么?我读过the original GraphSAGE paper,但我还不明白。有人能告诉我为什么它们是多个InputLayers吗?输出形状中的那些数字是什么?

EN

回答 1

Stack Overflow用户

发布于 2020-01-29 18:10:13

Graphsage以节点方式工作。因此,您对模型的第一个输入将是来自Input_layer_1N,1,1433的单个节点。我猜,您一定是设置了一个名为num_samples的超参数或每层的样本数为20,10。因此,将节点提供给graphsage模型的生成器将获取进入的第一个节点的20个相邻节点。第二层将获取第一个节点的邻居的另外10个邻居。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58515943

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档