|
|
@ -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)) |
|
|
|