Closed betterze closed 4 years ago
Hi, @betterze . I’m happy that you like it.
for example, the first image is class 20, the second image is class 21
When you know the number of images (TWO in above example) and each class (20 and 21 in above example) , you can implement as follows:
loss = lambda output: (output[0, 20] + output[1, 21]) / 2
Thanks!
thx a lot, I understand it now.
Dear Keisen,
Thank you for sharing with us this nice project. I really like it.
In attentions.ipynb, cell 4,
This loss function is only for images with the same class (20). If I want to use images with different classes (for example, the first image is class 20, the second image is class 21), how should I modify the code?
Thank you for your help.
Best Wishes,
Alex