A layer never runs just one filter. It runs several over the same picture at once, each hunting for its own pattern, and each one sliding across the whole picture produces its own feature map. Stack those maps and you have a block with a height, a width and a depth — and the depth is the number of filters.
Task: write feature_block(image, filters), returning that block with every value rounded to 4 decimal places.
image is a grayscale picture: a list of rows of numbers. It is not always square, so its height and its width have to be counted separately.filters is a list of filters. Each is a square grid of numbers, and every filter in one call is the same size — usually 3×3, but any size from 1×1 up to the size of the picture is legal.block[r][c] is a list holding one score per filter, in the order the filters were given — the scores every filter produced with its window's top-left corner on row r, column c of the picture.Height × width × depth is the same order you already use for a colour photo, and that is no accident — the block is the next layer's picture. At the input, the depth held red, green and blue. From here on each position holds one answer per filter: did this patch look like a vertical edge, a horizontal edge, a blob? The next layer receives all of those answers at once.