MCPcopy Create free account
hub / github.com/Tencent/embedx / HeterGraphSageEncoder

Function HeterGraphSageEncoder

src/model/encoder/graphsage_encoder.cc:116–132  ·  view source on GitHub ↗

Different namespaces use different encoders, and then concat the output of different encoders as the final representation

Source from the content-addressed store, hash-verified

114// Different namespaces use different encoders, and then concat the output of
115// different encoders as the final representation
116GraphNode* HeterGraphSageEncoder(const id_name_t& id_2_name,
117 const std::string& prefix,
118 const std::vector<GroupConfigItem3>& items,
119 int depth, bool use_neigh_feat, bool sparse,
120 double relu_alpha, int dim) {
121 std::vector<GraphNode*> hiddens;
122 GraphNode* hidden = nullptr;
123 for (auto& entry : id_2_name) {
124 auto ns_id = entry.first;
125 auto ns_name = entry.second;
126 hidden = GraphSageEncoder(prefix + std::to_string(ns_id) + ns_name, items,
127 depth, use_neigh_feat, sparse, relu_alpha, dim);
128 hiddens.emplace_back(hidden);
129 }
130 auto* next_hidden = Concat("", hiddens, 0);
131 return next_hidden;
132}
133
134} // namespace embedx

Callers

nothing calls this directly

Calls 1

GraphSageEncoderFunction · 0.85

Tested by

no test coverage detected