Computational Physics, Python, Linear Algebra, Svd, Code.
pW.data.normal_(std=0.01).abs_() pH.data.normal_(std=0.01).abs_(); def report(): W,H = pW.data, pH.data print((M-pW.mm(pH)).norm(2).data[0], W.min(), H.min(), (W<0).sum(), (H<0).sum()) def penalty(A): return torch.pow((A<0).type(tc.FloatTensor)*torch.clamp(A, max=0.), 2) def penalize(): return