目录
Spatial signals
Temporal signals
# Sequence
Sequence embedding
[b,seq_len,feature_len] # 1个句子10个单词每个单词4个意思,[1,10,4]
e.g. I like it.
import tensorflow as tftf.convert_to_tensor([[1,0,0],[0,1,0],[0,0,1]])
[b,100,1]
- [price,scalar,1] # 1-->1个点表示一个价格
[b,28,28]
- 对图片扫描的次数变成了时间的概念
Batch
[b,word num,word vec]
[word num,b,word vec]
[words,word vec]
- How to represent a word
- [Rome, Italy, ...]
- one hot
sparse
high-dim
semantic similarity
trainable
Word embedding
- Word2Vec vs GloVe
Embedding Layer
- Random initialized embedding
from tensorflow.keras import layersx = tf.range(5)x = tf.random.shuffle(x)x
net = layers.Embedding(10,4)net(x)
net.trainable
True
net.trainable_variables
[]