Skip to content

Releases: libwaifu/Waifu-SR

Waifu-SR::LapSRN

17 Aug 08:31
Compare
Choose a tag to compare
leakyReLU[alpha_] := ElementwiseLayer[Ramp[#] - alpha * Ramp[-#]&]
GetConvolution[i_] := {
	("convo_" <> i) -> ConvolutionLayer[64, 3, "PaddingSize" -> {1, 1}, "Biases" -> None],
	("leaky_" <> i) -> leakyReLU[0.2]
};
mainCNN = NetChain[{
	Table[GetConvolution[ToString@i], {i, 0, 10}],
	"decon_11" -> DeconvolutionLayer[64, 4, "Biases" -> None, "PaddingSize" -> {1, 1}],
	"leaky_11" -> leakyReLU[0.2],
	"convo_12" -> ConvolutionLayer[1, 3, "Biases" -> None, "PaddingSize" -> {1, 1}]
} // Flatten];
LapSRN = NetGraph[{
	"main" -> mainCNN,
	"res" -> DeconvolutionLayer[1, 4, "Biases" -> None, "PaddingSize" -> {1, 1}],
	"add" -> ThreadingLayer[Plus],
	"trans" -> TransposeLayer[{1<->3, 1<->2}]
}, {
	NetPort["Input"] -> "main",
	NetPort["Input"] -> "res",
	{"main", "res"} -> "add" -> "trans"
},
	"Input" -> NetEncoder[{"Image", {255, 255}, ColorSpace -> "Grayscale"}]
] // NetInitialize

Waifu-SR::VDSR

14 Aug 13:54
Compare
Choose a tag to compare
NetChain[
	Join[
		ConstantArray[{ConvolutionLayer[64, {3, 3}, "PaddingSize" -> 1], Ramp}, 19],
		{ConvolutionLayer[1, {3, 3}, "PaddingSize" -> 1], TransposeLayer[{1<->3, 1<->2}]}
	],
	"Input" -> {1, 255, 255}
] // NetInitialize

Waifu-SR::VGGSR

14 Aug 13:56
Compare
Choose a tag to compare
leakyReLU[alpha_] := ElementwiseLayer[Ramp[#] - alpha * Ramp[-#]&]
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", 128}],
	"Output" -> NetDecoder["Image"]
] // NetInitialize

v1.0.0

10 Sep 12:15
Compare
Choose a tag to compare
模型::add SRCNN and Waifu2X