More gradient stuff

pull/1/head
E. Almqvist 4 years ago
parent 5391205808
commit ac6cb89bfe
  1. 8
      rgbAI/lib/func.py

@ -53,9 +53,9 @@ class AIlib:
def gradient( dCost:float, prop:list ): def gradient( dCost:float, prop:list ):
propLen = len(prop) propLen = len(prop)
print("PropLEN: ", propLen) #print("PropLEN: ", propLen)
print(prop) #print(prop)
print("\n") #print("\n")
gradient = [None] * propLen gradient = [None] * propLen
for i in range( propLen ): for i in range( propLen ):
gradient[i] = dCost / prop[i] gradient[i] = dCost / prop[i]
@ -79,4 +79,4 @@ class AIlib:
weightDer = AIlib.gradient( dCost, weights ) weightDer = AIlib.gradient( dCost, weights )
biasDer = AIlib.gradient( dCost, bias ) biasDer = AIlib.gradient( dCost, bias )
print(weightDer, len(weightDer)) print(weights, len(weights))

Loading…
Cancel
Save