Created
August 27, 2018 19:38
-
-
Save NMZivkovic/3c5028f08da9b1e750233c73bd680eaf to your computer and use it in GitHub Desktop.
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
#Update all the weights | |
multiplytiplier = tf.stack([tf.tile(tf.slice( | |
learning_rate_matrix, np.array([i]), np.array([1])), [input_dim]) | |
for i in range(x*y)]) | |
delta = tf.multiply( | |
multiplytiplier, | |
tf.subtract(tf.stack([self._input for i in range(x*y)]), self._weights)) | |
new_weightages = tf.add(self._weights, delta) | |
self._training = tf.assign(self._weights, new_weightages) | |
#Initilize session and run it | |
self._sess = tf.Session() | |
initialization = tf.global_variables_initializer() | |
self._sess.run(initialization) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment