简体   繁体   中英

Why are there multiple inputlayers? GraphSAGE

I'm new to graph CNN and doing tutorials of GraphSAGE . And I ran the GraphSAGE Cora Node Classification Example, graphsage-cora-example.py . The task is to classify the node label of cora dataset.

When you run this code, you'll get the following model summary:

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

Why are there multiple input layers? And what are these numbers of output shape indicates? I read the original GraphSAGE paper however I don't understand yet. Can someone tell me why they're multiple InputLayers and what are those numbers indicates in Output Shape?

Graphsage works node wise. So, your first input to the model would be a single node coming from Input_layer_1[N, 1, 1433]. And I guess, you must have set a hyperparameter called num_samples or number of samples at each layer to [20, 10]. So the generator that gives the nodes to the graphsage model will take 20 neighboring nodes of the first node that goes in. The second layer will take 10 more neighbors of the neighbors of your first node.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM