coreference-resolution
coreference-resolution copied to clipboard
Error during training
I got this error while running python coref.py
loss = torch.sum(torch.log(torch.sum(torch.mul(probs, gold_indexes), dim=1).clamp_(eps, 1-eps), dim=0) * -1) TypeError: log() got an unexpected keyword argument 'dim'
I have removed dim parameter in log()
#loss = torch.sum(torch.log(torch.sum(torch.mul(probs, gold_indexes), dim=1).clamp_(eps, 1-eps), dim=0) * -1)
loss = torch.sum(torch.log(torch.sum(torch.mul(probs, gold_indexes)).clamp_(eps, 1-eps)) * -1)
Is it correct approach ?
There is no dim parameter in torch.log() (https://pytorch.org/docs/stable/torch.html#torch.log)
torch.log(input, out=None) → Tensor Returns a new tensor with the natural logarithm of the elements of input. yi=loge (xi)
Parameters input (Tensor) – the input tensor. out (Tensor, optional) – the output tensor.
I got this error while running python coref.py
loss = torch.sum(torch.log(torch.sum(torch.mul(probs, gold_indexes), dim=1).clamp_(eps, 1-eps), dim=0) * -1) TypeError: log() got an unexpected keyword argument 'dim'
I meet the same error,were you able to solve this error?
It seems this is the correct way loss = torch.sum(torch.log(torch.sum(torch.mul(probs, gold_indexes), dim=1).clamp_(eps, 1-eps)), dim=0) * -1