Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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