Removed small bugs

pull/1/head
E. Almqvist 4 years ago
parent 59fc19e181
commit 1493824ac7
  1. 6
      rgbAI/lib/func.py
  2. 2
      rgbAI/main.py

@ -38,14 +38,14 @@ class AIlib:
def propDer( dCost, dProp ): def propDer( dCost, dProp ):
# Calculate the partial derivative for that prop # Calculate the partial derivative for that prop
print("################") #print("################")
print(dCost, dProp) #print(dCost, dProp)
return dCost / dProp return dCost / dProp
def gradient( inp:np.array, obj, theta:float, maxLayer:int, layerIndex: int=0, grads=None, obj1=None, obj2=None ): # Calculate the gradient for that prop def gradient( inp:np.array, obj, theta:float, maxLayer:int, layerIndex: int=0, grads=None, obj1=None, obj2=None ): # Calculate the gradient for that prop
# Check if grads exists, if not create the buffer # Check if grads exists, if not create the buffer
if( not grads ): if( not grads ):
grads = [None] * maxLayer grads = [None] * (maxLayer+1)
# Create new instances of the object # Create new instances of the object
if( not obj1 or not obj2 ): if( not obj1 or not obj2 ):

@ -55,7 +55,7 @@ class rgb(object):
def init(): def init():
bot = rgb() bot = rgb()
bot.traintimes = 100 bot.traintimes = 1
bot.train() bot.train()

Loading…
Cancel
Save