From 23b128ad1123ffab876e1b4ce855bf978bffeb8d Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Sat, 29 Aug 2020 10:54:27 +0200 Subject: [PATCH] Fixed cost function --- rgbAI/lib/func.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rgbAI/lib/func.py b/rgbAI/lib/func.py index 85231d7..f079756 100644 --- a/rgbAI/lib/func.py +++ b/rgbAI/lib/func.py @@ -16,7 +16,7 @@ class AIlib: for i in range(outLen): sumC += (out[i] - correctOut[i])**2 # get the difference of every value - return sumC # return the average cost of all rows + return sumC / outLen # return the average cost of all rows def genRandomMatrix( x:int, y:int, min: float=0.0, max: float=1.0 ): # generate a matrix with x, y dimensions with random values from min-max in it return np.random.rand(x, y)