Computational Physics, Python, Linear Algebra, Svd, Code.
- mu, max=0.) def upd_t(M, W, H, lr): dW,dH = grads_t(M,W,H) W.sub_(lr*dW); H.sub_(lr*dH) def report_t(M,W,H): print((M-W.mm(H)).norm(2), W.min(), H.min(), (W<0).sum(), (H<0).sum()) t_W = tc.FloatTensor(m,d) t_H = tc.FloatTensor(d,n) t_W.normal_(std=0.01).abs_(); t_H.normal_(std=0.01).abs_(); d=6;