removed sigmoid from neuron plot

main
romanamo 2024-04-05 23:56:40 +02:00
parent e5b825b10d
commit a96c60c72b
1 changed files with 6 additions and 6 deletions

View File

@ -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