|
|
@ -54,7 +54,7 @@ class AIlib: |
|
|
|
def gradient( dCost:float, prop:list ): |
|
|
|
def gradient( dCost:float, prop:list ): |
|
|
|
propLen = len(prop) |
|
|
|
propLen = len(prop) |
|
|
|
gradient = [None] * propLen |
|
|
|
gradient = [None] * propLen |
|
|
|
for i in range( propLen, 0, -1 ): |
|
|
|
for i in range( propLen, -1, -1 ): |
|
|
|
if( i == propLen ): |
|
|
|
if( i == propLen ): |
|
|
|
gradient[i] = dCost / prop[i] |
|
|
|
gradient[i] = dCost / prop[i] |
|
|
|
else: |
|
|
|
else: |
|
|
|