A simple PyTorch implementation of "A Neural Algorithm of Artistic Style"
I try some other codes for neural-style-pytorch, but their outputs may become noise in some epochs, such as epoch 45, 170 and 230 in Figure 1. I don't know why. Therefore, I simply implement the method of "A Neural Algorithm of Artistic Style (http://arxiv.org/abs/1508.06576).
**Figure 1**
The output as shown in Table 1.
Style | Content | Output |
. | . | . |
. | . | . |
. | . | . |
**Table 1**
Outputs of some epochs as shown in Figure 2 and Table 2, the outputs may be more stable, and will not become noise suddenly.
**Figure 2**
epoch 0 | epoch 1000 | epoch 5000 | epoch 10000 |
. | . | . | . |
epoch 50000 | epoch 100000 | epoch 200000 | epoch 300000 |
. | . | . | . |
**Table 2**
Thanks for the reference codes as following:
[1] fast_neural_style https://github.com/pytorch/examples/tree/master/fast_neural_style
[2] neural-style-pytorch https://github.com/Zhenye-Na/neural-style-pytorch
[3] neural-style-pytorch https://github.com/L1aoXingyu/neural-transfer
The main program is neural_style.py. Inspired by [1], I calculate the losses in iterations directly, instead of modeling them in network. I also remove the normalization, and use Adam optimizer.
The optimization speed of this code may be slower than other PyTorch codes, which needs more epochs.