Skip to content
Discussion options

You must be logged in to vote

adding a few more prints to your function:

def tweedie_deviance_score(yhat, y):
    print(y/yhat)
    print(torch.log(y/yhat))
    print(y * torch.log(y/yhat))
    return 2 * (y * torch.log(y/yhat) + yhat - y)

and seems the problem is with inf as you can see:

tensor([0., 0., 0., 5., 0., 0.])
tensor([  -inf,   -inf,   -inf, 1.6094,   -inf,   -inf])
tensor([   nan,    nan,    nan, 1.6094,    nan,    nan])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Borda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants