NNW/supplement_files/NNW_P3_A1_Vorlage.py

31 lines
482 B
Python

# -*- coding: utf-8 -*-
#%%
# AG1a
import numpy as np
import nnwplot
def neuron(X):
N = X.shape[...]
net = np.zeros(N)
W = [....]
b = # Bias ... ergibt sich aus Aktivierungsschwelle
for n in range(0,N):
for j in range ...:
net[..]+=
b verwenden ...
return net ... # threshold ....
#%%
iris = np.loadtxt("iris.csv",delimiter=',')
X=iris[...]
T=iris[...]
print(X)
print(T)
#%%
# AG1b
nnwplot.plotTwoFeatures(X[...], T, neuron)