diff --git a/rgbAI/lib/func.py b/rgbAI/lib/func.py index 7a7d9b9..c47e1a8 100644 --- a/rgbAI/lib/func.py +++ b/rgbAI/lib/func.py @@ -48,5 +48,8 @@ class AIlib: print( "Max layer index: " + str(maxLayer) ) def gradient( cost1:float, cost2:float, inp1:np.array, inp2:np.array ): - return (cost2 - cost1) / (inp2 - inp1) + dY = np.asarray(cost2 - cost1) + dX = np.asarray(inp2 - inp1) + print(dY, dX) + return dY / dX