You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def compute_weights(self, sample):
for winner in self.winners:
W = self.nodes[winner]
h = self.thresholds[winner]
y = self.outputs[winner]
x = self.inputs[winner]
dh = self.learning_rate * (x - h)
h += dh
for i in range(len(W)):
if sample[i] == 1:
dwi = self.learning_rate * y
else:
dwi = -self.learning_rate * y
wi = W[i]
wi += dwi
if abs(wi) > 4:
wij = 4 * sign(wi)
W[i] = wi
self.nodes[winner] = W
self.thresholds[winner] = h
The text was updated successfully, but these errors were encountered:
wij
is unusedhttps://github.com/CarsonScott/HSOM/blob/master/hsom/self_organizing_map.py
The text was updated successfully, but these errors were encountered: