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

Function XInputEmbeddingLookup2

src/model/encoder/embedding_lookup_encoder.cc:37–45  ·  view source on GitHub ↗

randn initialization (0, 1e-3) for graph-ctr models

Source from the content-addressed store, hash-verified

35
36// randn initialization (0, 1e-3) for graph-ctr models
37GraphNode* XInputEmbeddingLookup2(const std::string& prefix, GraphNode* X,
38 const GroupConfigItem3& item, int sparse) {
39 DXCHECK_THROW(X->shape().is_rank(2));
40 int tensor_type = sparse ? TENSOR_TYPE_SRM : TENSOR_TYPE_TSR;
41 auto* W =
42 GetVariable(prefix + "W", Shape(item.embedding_row, item.embedding_col),
43 tensor_type, TENSOR_INITIALIZER_TYPE_RANDN, 0, 1e-3);
44 return EmbeddingLookup("", X, W);
45}
46
47// rand initiialization (-1 / col, 1 / col)
48GraphNode* XInputEmbeddingLookup3(const std::string& prefix, GraphNode* X,

Callers 2

InitGraphMethod · 0.85
InitGraphMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected