SwordHolderSH / neural-style-pytorch

A fast PyTorch implementation of "A Neural Algorithm of Artistic Style"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

neural-style-pytorch

A simple PyTorch implementation of "A Neural Algorithm of Artistic Style"

introduction

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**

Results

The output as shown in Table 1.

StyleContentOutput
.
.
.
.
.
.
.
.
.

**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 0epoch 1000epoch 5000epoch 10000
.
.
.
.
epoch 50000epoch 100000epoch 200000epoch 300000
.
.
.
.

**Table 2**

Acknowledge

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.

About

A fast PyTorch implementation of "A Neural Algorithm of Artistic Style"


Languages

Language:Python 100.0%