From 0e605a895c460c8f39b32f3161bef7aaed5d5351 Mon Sep 17 00:00:00 2001 From: Stefan Schweter Date: Thu, 30 Nov 2017 17:36:19 +0100 Subject: [PATCH] capsnet: fix margin loss formula --- extra_capsnets.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra_capsnets.ipynb b/extra_capsnets.ipynb index d088bae9e..e9ec9f2ea 100644 --- a/extra_capsnets.ipynb +++ b/extra_capsnets.ipynb @@ -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",