@@ -89,7 +89,7 @@ bottom. Note that this is different from existing libraries such as cuDNN and
89
89
Caffe, which explicitly specify the number of padded pixels and always pad the
90
90
same number of pixels on both sides.
91
91
92
- For the ` 'VALID ` ' scheme, the output height and width are computed as:
92
+ For the ` 'VALID' ` scheme, the output height and width are computed as:
93
93
94
94
out_height = ceil(float(in_height - filter_height + 1) / float(strides[1]))
95
95
out_width = ceil(float(in_width - filter_width + 1) / float(strides[2]))
@@ -98,10 +98,10 @@ and no padding is used.
98
98
99
99
Given the output size and the padding, the output can be computed as
100
100
101
- output[b, i, j, :] =
102
- sum_{di, dj } input[b, strides[1] * i + di - pad_top,
103
- strides[2] * j + dj - pad_left , ...] *
104
- filter[di, dj, ...]
101
+ $$ output[b, i, j, :] =
102
+ sum_{d_i, d_j } input[b, strides[1] * i + d_i - pad_{top},\
103
+ strides[2] * j + d_j - pad_{left} , ...] *
104
+ filter[d_i, d_j,\ ...] $$
105
105
106
106
where any value outside the original input image region are considered zero (
107
107
i.e. we pad zero values around the border of the image).
@@ -161,12 +161,12 @@ Morphological operators are non-linear filters used in image processing.
161
161
] ( https://en.wikipedia.org/wiki/Dilation_(morphology) )
162
162
is the max-sum counterpart of standard sum-product convolution:
163
163
164
- output[b, y, x, c] =
164
+ $$ output[b, y, x, c] =
165
165
max_{dy, dx} input[b,
166
166
strides[1] * y + rates[1] * dy,
167
167
strides[2] * x + rates[2] * dx,
168
168
c] +
169
- filter[dy, dx, c]
169
+ filter[dy, dx, c] $$
170
170
171
171
The ` filter ` is usually called structuring function. Max-pooling is a special
172
172
case of greyscale morphological dilation when the filter assumes all-zero
@@ -176,12 +176,12 @@ values (a.k.a. flat structuring function).
176
176
] ( https://en.wikipedia.org/wiki/Erosion_(morphology) )
177
177
is the min-sum counterpart of standard sum-product convolution:
178
178
179
- output[b, y, x, c] =
179
+ $$ output[b, y, x, c] =
180
180
min_{dy, dx} input[b,
181
181
strides[1] * y - rates[1] * dy,
182
182
strides[2] * x - rates[2] * dx,
183
183
c] -
184
- filter[dy, dx, c]
184
+ filter[dy, dx, c] $$
185
185
186
186
Dilation and erosion are dual to each other. The dilation of the input signal
187
187
` f ` by the structuring signal ` g ` is equal to the negation of the erosion of
0 commit comments