Initial commit

This commit is contained in:
George Lacey 2017-02-08 23:17:26 +00:00
parent a4e188d5f3
commit 428390082d
3 changed files with 29 additions and 0 deletions

11
Input.py Normal file
View File

@ -0,0 +1,11 @@
class Input(object):
def __init__(self, p_value, p_weight):
self.value = p_value
self.weight = p_weight
def print(self):
print("value: %f\nweight: %f") % (self.value, self.weight)
def setweight(self, p_weight):
self.weight = p_weight

0
Main.py Normal file
View File

18
Perceptron.py Normal file
View File

@ -0,0 +1,18 @@
from Input import Input
class Perceptron(object):
def __init__(self):
self.inputs = {}
def print(self):
for key, value in self.inputs:
print("%s - )") % key
value.print()
def addinput(self, p_name, p_value, p_weight):
self.inputs[p_name] = Input(p_value, p_weight)
def setweight(self, p_input, p_weight):
self.inputs[p_input].weight = p_weight