2020/11/25 COMP9444 Exercises 5
COMP9444 Neural Networks and Deep Learning Term 3, 2020
Exercises 6: Word Vectors This page was last updated: 11/08/2020 06:09:01
1. Consider the sentence
“two flowers grew tall on two tall towers”
a. Write the co-occurrence matrix X for this sentence, using a 4-word context window (i.e. two context words on either side of the central word)
b. Use torch.svd() to compute the singular value decompositon of this matrix X =
USVT
c. Extract a word representation from the first two columns of U and use matplotlib
to plot the words on a 2-dimensional graph.
Make sure you attempt the questions yourself, before looking at the Sample Solutions.
https://www.cse.unsw.edu.au/~cs9444/20T3/tut/Ex6_WordVectors.html 1/1