Open bilel-bj opened 4 years ago
print(y)
Thank you. This is what it returns to me. How to read these values.
print(y)
tensor([[ 1.9981, -1.9514]], device='cuda:0', grad_fn=<AddmmBackward>)
Since we adopt CELoss(https://pytorch.org/docs/stable/nn.html#torch.nn.CrossEntropyLoss), the output value is not probability. However, you can utilize the signs and abs() values to evaluate how sure the model is about this category.
Thanks for your reply. Do you know the equations how to convert these two value[ 1.9981, -1.9514]
into 1 value predicting the violence probability ?
Try SoftMax. Please inform me if it is feasible.
exp(1.9981)/(exp(1.9981)+exp(-1.9514))=0.98
?
Thanks for your reply. I added these two lines of codes and it works fine:
sm = torch.nn.Softmax()
probabilities = sm(y)
Thanks again for your consideration and support. How can I get the right violence probability instead of boolean value in the function predict:
It is more accurate to estimate the right probability of having violence in the video rather than getting boolean value.