eriklindernoren / Action-Recognition

Exploration of different solutions to action recognition in video, using neural networks implemented in PyTorch.
184 stars 74 forks source link

Softmax in Model Output, then using CE Loss #23

Open kerrgarr opened 2 years ago

kerrgarr commented 2 years ago

Thank you for the interesting work here.

I've just encountered one issue with the code. The ConvLSTM model outputs softmax as the last layer, but then in the training script CrossEntropyLoss is performed. CE Loss already performs a softmax on the input, so you do not want to do softmax on a softmax twice. Instead, the ConvLSTM should output the classification (Linear) layer prior to the Softmax to put into CE loss. The softmax probabilities can be computed later in the test set evaluation step to determine the test accuracy.

Please let me know if others agree with this small change to the code.

Also, what type of Attention is being used? Is it the dot-product?

takekbys commented 2 years ago

Same understanding. Softmax in the ConvLSTM.output_layers is not necessary.