Computer Vision with Neural Networks

Use the same detector everywhere

BOTIE

Extract each flattened 2-by-2 window at stride 1 in row order.
Ready to test
0 passed · 0 failed · 1 not run

An empty floor. Start with the information your machine needs.

Received result

Your answer will arrive here.

Examples, experiments and workspace controls
Live values

Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.

Try your own inputs

Change a single image pixel. Which windows include it, and which responses should therefore change? Follow that pixel through the window matrix before inspecting the final list.

Start at an output arrow, then click or drag to an input. Drag empty space to pan. Delete removes a selection. Ctrl/Cmd+Z undoes a change.
Context for this challenge

Extract each flattened 2-by-2 window at stride 1 in row order.

A handwritten stroke can appear in different parts of an image. We need the same detector to inspect every location. Let's slide one small kernel across the pixels and keep its responses in image order so we can see where the pattern was detected.

Inspect the component calculation
Slide a square window(
  Image: Image
  Window size: 2
  Stride: 1
)
Examples and results
Image
123
456
789
Required result
1245
2356
4578
5689
Try a fresh construction

This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.

Stuck? Inspect a worked construction

The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.

Assumptions and test precision

This is a small construction problem. The lesson explains the assumptions and the parts of the full method that this example leaves out. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.

A bright column has two edge directions

This check uses the pieces from “Apply one kernel to every overlapping image window”.

BOTIE

Slide the supplied flattened 2-by-2 filter across this image at stride one, without padding or flipping the filter. Return window responses in row-major order. Keep negative responses.
Image
030
030
030
Flattened kernel
  1. 0-1
  2. 11
  3. 2-1
  4. 31

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

Why would reversing the kernel change the meaning of this detector?

State the filter convention, stride and output ordering when comparing convolution implementations.

This is a small construction problem. The lesson explains the assumptions and the parts of the full method that this example leaves out.

Work through the Python challenges →
Continue the coursePooling →
← Deciding When a Training Run Has Done Enough