randn initialization (0, 1e-3) for graph-ctr models
| 35 | |
| 36 | // randn initialization (0, 1e-3) for graph-ctr models |
| 37 | GraphNode* 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) |
| 48 | GraphNode* XInputEmbeddingLookup3(const std::string& prefix, GraphNode* X, |