Implement the forward pass of a 3D convolutional layer. A 3D convolution slides a 3D kernel over a 3D input volume (like video frames or medical scans), computing dot products at each position. Given an input volume, kernel, stride, and padding, compute the output feature map. This is the core operation in 3D CNNs used for video analysis and medical imaging.
input=(1,2,2,2) values [[[1,2],[3,4]],[[5,6],[7,8]]], kernel=(1,2,2,2) with [1,0,0,0,0,0,0,0]
[[[[1.0]]]]
Kernel extracts top-left-front value. Dot product: 11+20+30+40+50+60+70+80=1. Output: single value 1.0 at position (0,0,0).