From d5a181ba39a529386d1914aa36bfa18c4842c6a9 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Wed, 30 Sep 2020 17:37:23 +0200 Subject: [PATCH] Bug fix --- rgbAI/lib/func.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rgbAI/lib/func.py b/rgbAI/lib/func.py index 8b535ca..daeecaf 100644 --- a/rgbAI/lib/func.py +++ b/rgbAI/lib/func.py @@ -42,7 +42,10 @@ class AIlib: print(dCost, dProp) return dCost / dProp - def gradient( inp:np.array, obj, theta:float, maxLayer:int, layerIndex: int=0, grads: list=[], obj1=None, obj2=None ): # Calculate the gradient for that prop + def gradient( inp:np.array, obj, theta:float, maxLayer:int, layerIndex: int=0, grads: list, obj1=None, obj2=None ): # Calculate the gradient for that prop + if( not grads ): + grads = [None] * maxLayer + # Create new instances of the object if( not obj1 or not obj2 ): obj1 = obj