File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 75
75
"""
76
76
PixelShuffle(r::Int)
77
77
78
- Pixel shuffling layer with upscale factor `r`.
78
+ Pixel shuffling layer with upscale factor `r`. Usually used for generating higher
79
+ resolution images while upscaling them.
79
80
80
81
See [`NNlib.pixel_shuffle`](@ref).
82
+
83
+ # Examples
84
+ ```jldoctest; filter = r"[+-]?([0-9]*[.])?[0-9]+"
85
+ julia> p = PixelShuffle(2);
86
+
87
+ julia> xs = rand(2, 2, 4, 1) # an image with 4 channels having 2X2 pixels in each channel
88
+ 2×2×4×1 Array{Float64, 4}:
89
+ [:, :, 1, 1] =
90
+ 0.826452 0.0519244
91
+ 0.0686387 0.438346
92
+
93
+ [:, :, 2, 1] =
94
+ 0.343179 0.445101
95
+ 0.543927 0.740905
96
+
97
+ [:, :, 3, 1] =
98
+ 0.105997 0.422996
99
+ 0.32957 0.167205
100
+
101
+ [:, :, 4, 1] =
102
+ 0.825737 0.98609
103
+ 0.757365 0.294784
104
+
105
+ julia> p(xs) # an image with only 1 channel with 4X4 pixels in the single channel
106
+ 4×4×1×1 Array{Float64, 4}:
107
+ [:, :, 1, 1] =
108
+ 0.826452 0.105997 0.0519244 0.422996
109
+ 0.343179 0.825737 0.445101 0.98609
110
+ 0.0686387 0.32957 0.438346 0.167205
111
+ 0.543927 0.757365 0.740905 0.294784
112
+ ```
81
113
"""
82
114
struct PixelShuffle
83
115
r:: Int
You can’t perform that action at this time.
0 commit comments