Weight normalization (Salimans & Kingma, 2016) splits each weight vector into a length g and a direction v / ||v||. Training then adjusts length and direction separately, which speeds up optimization.
Implement weight_norm(v, g), which builds the weight matrix with each row of length g[i] pointing along v[i].
v has shape (out, in), g has shape (out,).Divide each row of v by its norm, then multiply each row by its g value.
No results yet
Run your code to check it against the examples, or submit to run every test.