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
Hello, first of all, thank you for sharing, and gave me a lot of help.
defupdate_weights(self, inputVec, sigma, lrate, bmu):
"""Update the node Weights. Args: inputVec (np.array): A weights vector whose distance drives the direction of the update. sigma (float): The updated gaussian sigma. lrate (float): The updated learning rate. bmu (somNode): The best matching unit. """dist=self.get_nodeDistance(bmu)
gauss=np.exp(-dist*dist/(2*sigma*sigma)) # I think gauss will always > 0ifgauss>0:
foriinrange(len(self.weights)):
self.weights[i] =self.weights[i] -gauss*lrate*(self.weights[i]-inputVec[i])
In somNode::update_weights() , expression ' gauss > 0 ' will always be true.
So throughout the training process, the weights of all nodes will be changed.
I read some literature. The literature says that the node weights near BMU should be updated, and this neighborhood is gradually reduced, eventually containing only BMU itself.
So, I think we should change ' gauss >0' to 'gauss>x ' (0<x<1)
Thank you again for sharing and looking forward to your reply.
The text was updated successfully, but these errors were encountered:
the radius of the Gaussian is determined by the sigma which is reduced at every step by update_sigma, thus effectively reducing the neighborhood set.
You are however right about the Gaussian being always > 0, unless the sigma gets infinitely small.
I haven't looked at the code in a while and I'm not sure why I put that condition. Possibly it was just a debugging device which forgot to remove.
Just let me think it over and do a couple of extra tests. If I still can't find a justification for its presence I will remove it in the next version.
Hello, first of all, thank you for sharing, and gave me a lot of help.
In somNode::update_weights() , expression ' gauss > 0 ' will always be true.
So throughout the training process, the weights of all nodes will be changed.
I read some literature. The literature says that the node weights near BMU should be updated, and this neighborhood is gradually reduced, eventually containing only BMU itself.
So, I think we should change ' gauss >0' to 'gauss>x ' (0<x<1)
Thank you again for sharing and looking forward to your reply.
The text was updated successfully, but these errors were encountered: