Geometry of Linear Transformations with Word Embeddings
torch.nn.functional.cosine_similarity
tf.linalg.matmul (TF); verify the residual is orthogonal to the subspace
Lab Overview
Word embeddings are high-dimensional vectors — but most of the interesting structure lives in the geometry: norms, dot products, angles, and subspace projections. In this lab you will load real GloVe vectors, build intuition for vector geometry, and connect it directly to the operations that power embedding-based retrieval and attention.
What You Will Build
A notebook that (1) computes norms and cosine similarities across a vocabulary slice, (2) visualises how matrix operations transform subspaces, and (3) implements orthogonal projection and verifies the General = Particular + Homogeneous decomposition on a toy linear system — all in both PyTorch and TensorFlow.