| 15 | namespace embedx { |
| 16 | |
| 17 | GraphNode* PinsageEncoder(const std::string& prefix, GraphNode* hidden, |
| 18 | GraphNode* self_block, GraphNode* neigh_block, |
| 19 | int dim, double alpha) { |
| 20 | // self |
| 21 | auto* self_embed = HiddenLookup("", self_block, hidden); |
| 22 | |
| 23 | // neigh |
| 24 | auto* hidden_fc = |
| 25 | deepx_core::FullyConnect(prefix + "_hidden_fc", hidden, dim); |
| 26 | auto* hidden_fc_act = deepx_core::LeakyRelu("", hidden_fc, alpha); |
| 27 | auto* neigh_embed = MeanAggregator("", neigh_block, hidden_fc_act); |
| 28 | |
| 29 | auto* concat = deepx_core::Concat("", {self_embed, neigh_embed}); |
| 30 | auto* concat_fc = |
| 31 | deepx_core::FullyConnect(prefix + "_concat_fc", concat, dim); |
| 32 | auto* sage_embed = deepx_core::LeakyRelu("", concat_fc, alpha); |
| 33 | return sage_embed; |
| 34 | } |
| 35 | |
| 36 | GraphNode* PinsageRootEncoder(const std::string& prefix, GraphNode* hidden, |
| 37 | int dim, double alpha) { |
no test coverage detected