I try to explain my goal. With a trained model I want to select the output class and update the feeded image.
Some hint?
You can use tf.gradients
to back propagate to the input layer:
...
logits = run_net(image)
g = tf.gradients(logits[target_class], image)
image += g[0] * step
...
Good examples of doing this can be found in the Deep Dream demo code (see for example "Naive feature visualization" or "Multiscale image generation."