Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created August 27, 2018 19:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save NMZivkovic/4d73d596a77eefb4a0e5aadb1fd05570 to your computer and use it in GitHub Desktop.
#Adapt learning rate to each neuron based on position
bmu_matrix = tf.stack([bmu_location for i in range(x*y)])
bmu_distance = tf.reduce_sum(tf.pow(tf.subtract(self._locations, bmu_matrix), 2), 1)
neighbourhood_func = tf.exp(tf.negative(tf.div(tf.cast(bmu_distance, "float32"), tf.pow(_current_radius, 2))))
learning_rate_matrix = tf.multiply(_current_learning_rate, neighbourhood_func)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment