|
Algorithm 1. Feature Extraction Algorithm Based on GraphSAGE. |
|
Input: directed graph , initial node feature vector , sample size , sampling depth , weight matrix , nonlinear activation function , aggregation function
|
|
Output: Hidden feature vector of each node
|
-
1:
initial state of each node in the network
-
2:
for k = 1, 2, …, K
-
3:
for
-
4:
Sample s neighbor nodes of and aggregate them using a mean aggregator:
-
5:
Concatenate the aggregated neighbor features with the node features :
-
6:
end
-
7:
Normalize the result using a norm
-
8:
end
-
9:
Obtain the final hidden feature vector of the node
|