Skip to content

Commit

Permalink
模型::add SRCNN and Waifu2X
Browse files Browse the repository at this point in the history
  • Loading branch information
oovm committed Aug 12, 2018
1 parent 5e544fe commit 6d75dd8
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 1 deletion.
Empty file added Config/Formater.m
Empty file.
9 changes: 8 additions & 1 deletion Kernel/init.m
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
Get["WaifuSR`WaifuSR`"];
If[$CharacterEncoding =!= "UTF-8",
$CharacterEncoding = "UTF-8";
Echo[Style["$CharacterEncoding has been changed to UTF-8 to avoid problems.", Red], "Warning: \n"];
st = OpenAppend[FindFile["init.m"]];
WriteString[st, "$CharacterEncoding=\"UTF-8\";"];
Close[st];
];
Get["WaifuSR`WaifuSR`"];
Empty file added Resources/Model/Readme.md
Empty file.
38 changes: 38 additions & 0 deletions Training/SRCNN/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@



## SRCNN

```
net = NetChain[{
ResizeLayer[{Scaled[2], Scaled[2]}]
ConvolutionLayer[32, {3, 3}], ElementwiseLayer[Ramp],
ConvolutionLayer[32, {3, 3}], ElementwiseLayer[Ramp],
ConvolutionLayer[3, {3, 3}]
},
"Input" -> {3, Automatic, Automatic},
"Output" -> NetDecoder["Image"]
] // NetInitialize
```


## VGG-SR

SRCNN 的变种, Waifu2X 作者所选择的网络

```
leakyReLU[alpha_] := ElementwiseLayer[Ramp[#] - alpha * Ramp[-#]&]
chain = NetChain[{
ResizeLayer[{256 + 14, 256 + 14}],
ConvolutionLayer[32, {3, 3}], leakyReLU[0.1],
ConvolutionLayer[32, {3, 3}], leakyReLU[0.1],
ConvolutionLayer[64, {3, 3}], leakyReLU[0.1],
ConvolutionLayer[64, {3, 3}], leakyReLU[0.1],
ConvolutionLayer[128, {3, 3}], leakyReLU[0.1],
ConvolutionLayer[128, {3, 3}], leakyReLU[0.1],
ConvolutionLayer[3, {3, 3}]
},
"Input" -> NetEncoder[{"Image", 32}],
"Output" -> NetDecoder["Image"]
] // NetInitialize
``
3 changes: 3 additions & 0 deletions Training/SRCNN/SRCNN_train.nb
Git LFS file not shown

0 comments on commit 6d75dd8

Please sign in to comment.