removed sigmoid from neuron plot
parent
e5b825b10d
commit
a96c60c72b
|
@ -15,16 +15,16 @@ grad = np.zeros(3)
|
|||
def sigmoid(summe): # Transferfunktion
|
||||
return 1.0/(1.0+np.exp(-1.0*summe))
|
||||
|
||||
def perceptron(output):
|
||||
return max(np.sign(output), 0)
|
||||
|
||||
vperceptron = np.vectorize(perceptron)
|
||||
|
||||
def learn():
|
||||
#TODO implement here
|
||||
global train, weight, out, target, learnrate
|
||||
# Neuronenausgabe für alle 4 Trainingsmuster berechnen
|
||||
|
||||
def perceptron(output):
|
||||
return max(np.sign(output), 0)
|
||||
|
||||
vperceptron = np.vectorize(perceptron)
|
||||
|
||||
out = vperceptron(np.matmul(train, weight))
|
||||
|
||||
for j in range(4):
|
||||
|
@ -40,7 +40,7 @@ def outp(N=100): # Daten für die Ausgabefunktion generieren
|
|||
x = np.linspace(0, 1, N)
|
||||
y = np.linspace(0, 1, N)
|
||||
xx, yy = np.meshgrid(x, y)
|
||||
oo = sigmoid(weight[0] + weight[1]*xx + weight[2]*yy)
|
||||
oo = vperceptron(weight[0] + weight[1]*xx + weight[2]*yy)
|
||||
return xx, yy, oo
|
||||
|
||||
def on_close(event): # Fenster schließen
|
||||
|
|
Loading…
Reference in New Issue