Tensorflow发布了在TF2.0Keras中实现word2vec的官方指南
https://www.tensorflow.org/tutorials/text/word_embeddings
然而,它缺少负采样,这在word2vec中非常重要,这是不幸的,因为原始的张量流有一些很好的候选采样函数。你知道吗
我最想做的就是扩充模型
model = keras.Sequential([
layers.Embedding(encoder.vocab_size, embedding_dim),
layers.GlobalAveragePooling1D(),
layers.Dense(1, activation='sigmoid')
])
或许可以使用函数API而不是顺序API。你知道吗
我看到c++tf2.0有候选采样操作https://www.tensorflow.org/api_docs/cc/group/candidate-sampling-ops
这些可以并入Keras吗?你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐