Skip to content

Commit

Permalink
capsnet: fix margin loss formula
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-it committed Nov 30, 2017
1 parent 6a3072a commit 0e605a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extra_capsnets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@
"source": [
"The paper uses a special margin loss to make it possible to detect two or more different digits in each image:\n",
"\n",
"$ L_k = T_k \\max(0, m^{+} - \\|\\mathbf{v}_k\\|)^2 - \\lambda (1 - T_k) \\max(0, \\|\\mathbf{v}_k\\| - m^{-})^2$\n",
"$ L_k = T_k \\max(0, m^{+} - \\|\\mathbf{v}_k\\|)^2 + \\lambda (1 - T_k) \\max(0, \\|\\mathbf{v}_k\\| - m^{-})^2$\n",
"\n",
"* $T_k$ is equal to 1 if the digit of class $k$ is present, or 0 otherwise.\n",
"* In the paper, $m^{+} = 0.9$, $m^{-} = 0.1$ and $\\lambda = 0.5$.\n",
Expand Down

0 comments on commit 0e605a8

Please sign in to comment.