Implement a single 2D convolution layer forward pass for channel-first tensors.
Input: x of shape (N, C_in, H, W)
Weights: W of shape (C_out, C_in, KH, KW)
Bias: b of shape (C_out,)
Output: y of shape (N, C_out, H_out, W_out)
where H_out = H - KH + 1, W_out = W - KW + 1
Input: x = np.ones((1,1,3,3)) (all ones)
Kernel: W = np.ones((1,1,2,2)), b = [0]
Process: Each 2×2 patch sums to 4
Output: [[[[4., 4.], [4., 4.]]]] (2×2 output)
Sign in to take notes on this problem
Accepts: array
Accepts: array
Accepts: array
Implement a single 2D convolution layer forward pass for channel-first tensors.
Input: x of shape (N, C_in, H, W)
Weights: W of shape (C_out, C_in, KH, KW)
Bias: b of shape (C_out,)
Output: y of shape (N, C_out, H_out, W_out)
where H_out = H - KH + 1, W_out = W - KW + 1
Input: x = np.ones((1,1,3,3)) (all ones)
Kernel: W = np.ones((1,1,2,2)), b = [0]
Process: Each 2×2 patch sums to 4
Output: [[[[4., 4.], [4., 4.]]]] (2×2 output)
Sign in to take notes on this problem
Accepts: array
Accepts: array
Accepts: array