From c3918da2c7848e0b53b824a48ac475e45af03733 Mon Sep 17 00:00:00 2001 From: lint-tech Date: Sat, 13 May 2023 05:15:55 +0500 Subject: [PATCH] Fix error in total cost calculation in network2.py --- network2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network2.py b/network2.py index 9ecaa5b..aab18bb 100644 --- a/network2.py +++ b/network2.py @@ -312,7 +312,7 @@ def total_cost(self, data, lmbda, convert=False): a = self.feedforward(x) if convert: y = vectorized_result(y) cost += self.cost.fn(a, y)/len(data) - cost += 0.5*(lmbda/len(data))*sum(np.linalg.norm(w)**2 for w in self.weights) # '**' - to the power of. + cost += 0.5*(lmbda/len(data))*sum(np.linalg.norm(w)**2 for w in self.weights) # '**' - to the power of. return cost def save(self, filename):