We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
hard
research
Depthwise Separable Convolution
Implement Depthwise Separable Convolution from “Xception: Deep Learning with Depthwise Separable Convolutions” (Chollet, 2017).
A depthwise separable convolution factorizes a standard convolution into:
- Depthwise conv: Apply a separate filter to each input channel (1D for simplicity)
- Pointwise conv: 1x1 convolution to mix channels
Given (1D case for simplicity):
-
x: shape(C_in, L)— C_in channels, length L -
dw_filters: shape(C_in, K)— one filter per channel, kernel size K -
pw_weights: shape(C_out, C_in)— pointwise mixing weights
Steps:
-
Depthwise: for each channel c, convolve x[c] with dw_filters[c] (valid padding)
Output shape:
(C_in, L-K+1) -
Pointwise: multiply by pw_weights at each position
Output shape:
(C_out, L-K+1)
Output: Tensor of shape (C_out, L-K+1).
Hints
depthwise-separable
xception
chollet-2017
efficient-conv
cnn
Sign in to attempt this problem and view the solution.