function with respect to content can be defined as:

$$L_{content} (\mathbf{S},\mathbf{X},l) = \frac{1}{2}\sum_{i,j} (F_{ip}^l-P_{ip}^l)^2$$

To underline the correlations between activations, the algorithm uses the Gram matrix; $G_{ip}^l$ is the inner product between the vector versions of the $i^{th}$ and $p^{th}$ feature maps of the $l^{th}$ layer: $$G_{ip}^l = \sum_k F_{ik}^lF_{pk}^l$$

With the Gram matrix defined, the contribution of each layer is brought into discussion. The $l^{th}$ layer is composed of $N_l$ feature maps of size $M_l$. Thus, considering, besides $\mathbf{X}$, the style source image $\mathbf{R}$, the Gram representations $A^l$ and $G^l$ are computed for layer $l$. The contribution of a certain layer and the total style loss function are:

$$E_l=\frac{1}{4N_l^2M_l^2}\sum_{i,j}(G_{ip}^l-A_{ip}^l)^2$$

$$L_{style}(\mathbf{A},\mathbf{X})=\sum_{l=0}^Lw_lE_l$$

The total loss function, which takes into account both content and style is a linear combination of the two aforementioned components:

$$L_{total}(\mathbf{X},\mathbf{S},\mathbf{R})=\alpha L_{content}(\mathbf{S},\mathbf{X})+\beta
L_{style}(\mathbf{A},\mathbf{X})$$

where $\alpha$ and $\beta$ are manually picked weights.

The dramatic visual impact of the original visual style transfer method encouraged other works to address the same subject. Li et al. [@li2017] showed that, in fact, this version of style transfer minimizes the Maximum Mean Discrepancy (MMD) with the second order polynomial kernel thus implementing another version of matching the feature distributions. Maximum Mean Discrepancy (MMD) 