Added ai class and more func

pull/1/head
E. Almqvist 4 years ago
parent 3761927923
commit 8d955c5e7a
  1. BIN
      lib/__pycache__/func.cpython-38.pyc
  2. 7
      lib/func.py
  3. 16
      main.py

@ -3,5 +3,8 @@ import numpy as np
def sigmoid(x): def sigmoid(x):
return 1/(1 + np.exp(-x)) return 1/(1 + np.exp(-x))
def correctFunc(rgb): def correctFunc(rgb): # generates the correct answer for the AI
return ( rgb[0], rgb[1], rgb[2] ) return ( rgb[2], rgb[1], rgb[0] ) # basically invert the rgb values
def genRandomMatrix( x:int, y:int ):
return np.random.rand(x, y)

@ -1 +1,17 @@
#!/usr/bin/env python #!/usr/bin/env python
from lib.func import *
class rgb(object):
def __init__(self):
self.weights = 1
def think(self, inputMatrix):
print("thonk: " + str( sigmoid(self.weights) ))
def init(): # init func
bot = rgb()
bot.think(1)
init()

Loading…
Cancel
Save