cleanUrl: "what-is-depthwise-convolution"
description: "Depthwise convolution을 쉽게 설명합니다."

정의

코드로 이해해보자

x = torch.randn([1, 4, 10])

일반적인 Convolution filter의 weight 모양

conv = nn.Conv1d(4, 4, 3)
conv(x).shape  # (1, 4, 8)

Depthwise convolution filter의 weight 모양

d_conv = nn.Conv1d(4, 4, 3, groups=4)
d_conv(x).shape  # (1, 4, 8)
conv.weight.shape  # (4, 1, 3)