translate.py 不使用嵌入?

translate.py doesnt use embedding?

我正在尝试了解 tensorflow 中的 lstm-with-attention 脚本: https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/models/rnn/translate

这不使用嵌入,即使它调用 embedding_rnn_seq2seq,但输入此调用的只是标量词 ID,而不是任何类型的嵌入向量。

至少我找不到嵌入参数,也找不到矩阵,也找不到提供预训练嵌入的可能性。任何的想法?谢谢大家

translate.py does use an embedding, but its creation is buried deep in the implementation. The model uses the (undocumented) tf.nn.seq2seq.embedding_attention_seq2seq() function, which creates a tf.nn.rnn_cell.EmbeddingWrapper 中用于内部创建嵌入矩阵的代码。