From d45c5a3b6730ec4c866f7ae0c03dd16330b657a4 Mon Sep 17 00:00:00 2001 From: Dael Date: Thu, 14 Feb 2019 22:11:10 +0800 Subject: [PATCH] fix L2 error --- DeepLearnMac/ManagedNN.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeepLearnMac/ManagedNN.cs b/DeepLearnMac/ManagedNN.cs index 0e9e490..feeaa99 100644 --- a/DeepLearnMac/ManagedNN.cs +++ b/DeepLearnMac/ManagedNN.cs @@ -112,7 +112,7 @@ public void BackPropagation(ManagedArray training) for (var i = 0; i < Y_output.Length(); i++) { - L2 += Math.Sqrt(D3[i] * D3[i]); + L2 += (D3[i] * D3[i]); Cost += (-Y_output[i] * Math.Log(Yk[i]) - (1 - Y_output[i]) * Math.Log(1 - Yk[i])); }