Deep-learning-activity-recognition icon indicating copy to clipboard operation
Deep-learning-activity-recognition copied to clipboard

Bug in code

Open datonefaridze opened this issue 3 years ago • 1 comments

Hello, you have a bug in your code, when you use nn.CrossEntropyLoss() it automatically applies softmax function, so you should input just raw outputs,but instead you input vector in softmax layer and then you apply it to nn.CrossEntropyLoss() loss, that is mistake. here is link: https://github.com/jindongwang/Deep-learning-activity-recognition/blob/6ec30f24c54f47d30fbaae875a9cd40aba256442/pytorch/main_pytorch.py#L23

datonefaridze avatar Jan 07 '21 21:01 datonefaridze

@datonefaridze Much thanks for pointing this out! It is true that I shouldn't use F.softmax before nn.CrossEntropyLoss! I'll update the code.

jindongwang avatar Jan 08 '21 01:01 jindongwang