Skip to content

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

Notifications You must be signed in to change notification settings

SwordHolderSH/neural-style-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages