The identification of content and style are core elements of a Neural Style Transfer
(NST). The agreement of the content and style of two images is measured with the
pystiche these losses are implemented
Loss s are differentiated between two types:
RegularizationLoss works without any context while a
ComparisonLoss compares two images. Furthermore,
pystiche differentiates between two different domains an
Loss can work on:
EncodingOperator . A
operates directly on the
input_image while an
EncodingOperator encodes it first.
pystiche supports four archetypes:
One of the main improvements of NST compared to traditional approaches is that the
agreement is not measured in the pixel or a handcrafted feature space, but rather in
the learned feature space of a Convolutional Neural Network called
Especially variants of the
style_loss depend upon encodings, i. e. feature maps,
from various layers of the encoder.
pystiche offers a
MultiLayerEncoder that enables to extract all required encodings
after a single forward pass. If the same operator should be applied to different layers
MultiLayerEncodingLoss can be used.
PerceptualLoss combines all
s in a single measure acting as joint optimization criterion. How the optimization is
performed will be detailed in the next section.