Created
August 27, 2018 19:36
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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