Lesson 13
Lesson 13
Embeddings
Semantic Space
Word embeddings
Word embeddings
• How to handle discrete data?
• Solution 1: 1-hot vectors
• Solution 2: dense vectors
Semantic spaces
Plants
Food Buildings
Animals
Tools
Robots
Automobiles
Supervised learning of embedding
It is often easier to obtain relative similarity
• Define a hinge-loss:
• Map every word
• Learn the mapping with a deep network
Siamese network
The importance of selecting hard negatives
• Contrastive loss is a ranking loss, only the order matters
• Selecting hard negatives is key to faster convergence
Unsupervised learning of embedding
• Use the context:
• The dog chased the little ______, who climbed up the tree
Unsupervised learning of embedding
Word2Vec: continuous bag of words (CBOW) version
Map the output to probabilities
using softmax: