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
您好!我发现多轮训练后会出现 Loss: nan 的情况,仔细看代码,有一点点不是特别明白想请教您:如下代码中计算loss时为何需要先exp()再求log呢?这里如果score[0][x][y]如果为0,就会出现loss等于nan的情况.另外,这里求loss与论文中似乎有点差别呢?期待您的解答.
check if indexed correctly
loss = []
for i in range(len(all_matches[0])):
x = all_matches[0][i][0]
y = all_matches[0][i][1]
loss.append(-torch.log( scores[0][x][y].exp() )) # check batch size == 1 ?
The text was updated successfully, but these errors were encountered:
您好!我发现多轮训练后会出现 Loss: nan 的情况,仔细看代码,有一点点不是特别明白想请教您:如下代码中计算loss时为何需要先exp()再求log呢?这里如果score[0][x][y]如果为0,就会出现loss等于nan的情况.另外,这里求loss与论文中似乎有点差别呢?期待您的解答.
check if indexed correctly
The text was updated successfully, but these errors were encountered: