promptdojo_

CNNs and local patterns — step 6 of 7

Write conv1d(signal, kernel) — the general sliding window for any kernel length. Run the spike detector [-1, 2, -1] (fires when a value towers over BOTH neighbors) on the signal, print the response, then locate the strongest response and print f"spike centered at index {peak + 1}" (window position + 1 is the window's center).

full-screen editor opens — close anytime to keep reading.