Path: blob/master/second_edition/chapter12_part03_neural-style-transfer.ipynb
713 views
Kernel: Python 3
This is a companion notebook for the book Deep Learning with Python, Second Edition. For readability, it only contains runnable code blocks and section titles, and omits everything else in the book: text paragraphs, figures, and pseudocode.
If you want to be able to follow what's going on, I recommend reading the notebook side by side with your copy of the book.
This notebook was generated for TensorFlow 2.6.
Neural style transfer
The content loss
The style loss
Neural style transfer in Keras
Getting the style and content images
In [0]:
Auxiliary functions
In [0]:
Using a pretrained VGG19 model to create a feature extractor
In [0]:
Content loss
In [0]:
Style loss
In [0]:
Total variation loss
In [0]:
Defining the final loss that you'll minimize
In [0]:
Setting up the gradient-descent process
In [0]: