使用TensorFlow v2.0实现Word2Vec算法计算单词的向量表示,这个例子是使用一小部分维基百科文章来训练的. 更多信息请查看论文: Mikolov, Tomas et al. "Efficient Estimation of Word Representations in Vector Space.", 20131 from __future__ import division, print_function, absolute_import import collect
使用TensorFlow v2.0的基本张量操作 from __future__ import print_function import tensorflow as tf # 定义张量常量 a = tf.constant(2) b = tf.constant(3) c = tf.constant(5) # 各种张量操作 # 注意:张量也支持python的操作( ,*,...) add = tf.add(a,b) sub = tf.subtract(a,b) mul = tf.multiply(