higgsfield / Capsule-Network-Tutorial

Pytorch easy-to-follow Capsule Network tutorial
762 stars 135 forks source link

margin loss wrong #1

Open DanlanChen opened 6 years ago

DanlanChen commented 6 years ago

Hello, I think your magin loss is wrong, according to the paper, after relu, there is a square you forgot

DanlanChen commented 6 years ago

I think it should be left = ((F.relu(0.9 - v_c))2).view(batch_size, -1) right = ((F.relu(v_c - 0.1))2).view(batch_size, -1)

alexlopezcifuentes commented 6 years ago

I have also noticed that little mistake and reviewing the paper it is clear that there are two missing squares.