You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While running the following codes: net = NMF(data.shape, rank=self.basis_num, W=torch.Tensor(self.W), trainable_W=False).cuda() net.fit(data.cuda(), verbose=True, max_iter=200, tol=1e-18, beta=1)
I received the error message, any idea?
/content/pytorchNMF/torchnmf/nmf.py in fit(self, V, beta, tol, max_iter, verbose, alpha, l1_ratio)
281
282 with torch.no_grad():
--> 283 WH = self.reconstruct(H, W)
284 loss_init = previous_loss = beta_div(WH, V, beta).mul(2).sqrt().item()
285
@schonkopf
If the Vshape argumet (the first argument) is specified, it will overrided other arguments like W and H.
To use custom template tensor, in your case, you have to manually set W and H.
In the newest commit e4563b2 I add an warning note in class docstring. Also, I changed the behavior of trainable_* arguments to only take effect when template tensor is given, it's also written in docstring.
While running the following codes: net = NMF(data.shape, rank=self.basis_num, W=torch.Tensor(self.W), trainable_W=False).cuda() net.fit(data.cuda(), verbose=True, max_iter=200, tol=1e-18, beta=1)
This way will work without error now, though W would be replaced by random weights.
While running the following codes:
net = NMF(data.shape, rank=self.basis_num, W=torch.Tensor(self.W), trainable_W=False).cuda()
net.fit(data.cuda(), verbose=True, max_iter=200, tol=1e-18, beta=1)
I received the error message, any idea?
/content/pytorchNMF/torchnmf/nmf.py in fit(self, V, beta, tol, max_iter, verbose, alpha, l1_ratio)
281
282 with torch.no_grad():
--> 283 WH = self.reconstruct(H, W)
284 loss_init = previous_loss = beta_div(WH, V, beta).mul(2).sqrt().item()
285
/content/pytorchNMF/torchnmf/nmf.py in reconstruct(H, W)
486 @staticmethod
487 def reconstruct(H, W):
--> 488 return F.linear(H, W)
489
490
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py in linear(input, weight, bias)
1690 ret = torch.addmm(bias, input, weight.t())
1691 else:
-> 1692 output = input.matmul(weight.t())
1693 if bias is not None:
1694 output += bias
AttributeError: 'NoneType' object has no attribute 't'
The text was updated successfully, but these errors were encountered: