import numpy as np
            
            #toes %win #fans
ih_wgt = np.array([ 
            [0.1, 0.2, -0.1],    #hid[0]
            [-0.1, 0.1, 0.9],    #hid[1]
            [0.1, 0.4,  0.1]]).T #hid[2]

            # hid[0] hid[1] hid[2]
hp_wgt = np.array([  
            [0.3, 1.1, -0.3],    #verletzt?
            [0.1, 0.2,  0.0],    #Sieg?
            [0.0, 1.3,  0.1]]).T #traurig?

weights = [ih_wgt, hp_wgt]

def neural_network(input, weights):
    hid = input.dot(weights[0])
    pred = hid.dot(weights[1])
    return pred

toes =  np.array([8.5, 9.5, 9.9, 9.0]) # ersten 4 Spiele der Saison
wlrec = np.array([0.65,0.8, 0.8, 0.9])
nfans = np.array([1.2, 1.3, 0.5, 1.0])

input = np.array([toes[0],wlrec[0],nfans[0]]) # nur das 1. Spiel

pred = neural_network(input,weights)
print(pred)  # [0.2135 0.145  0.5065]


Für die endgültige Voraussage wird das KNN von vorne Schicht für Schicht durchlaufen. Diesen Vorgang nennt man Forward Propagation (Vorwärtsausbreitung).

Last modified: Wednesday, 3 September 2025, 9:02 AM