Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created August 27, 2018 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/3c5028f08da9b1e750233c73bd680eaf to your computer and use it in GitHub Desktop.
Save NMZivkovic/3c5028f08da9b1e750233c73bd680eaf to your computer and use it in GitHub Desktop.
#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