I am following the tutorial on neural style transfer. The style transfer is done by minimizing a loss function with respect to an image (initialized with the content image). What confuses me is the following piece of code:
preprocessed_input = tf.keras.applications.vgg19.preprocess_input(inputs)
which is part of the call
method in the StyleContentModel
class. How does TensorFlow know the gradient of this operation? I have checked if this operation has a gradient function using get_gradient_function
in the module tensorflow.python.framework.ops
, and as far as I can tell it does not.