Choose a language and read the cells in order. These are small teaching examples; the visual lesson runs separately.
Follow the calculation
Same inputs · Same operation · Same result
3 teaching cells · Python standard library · Read-only
1. Prepare the inputs
Use these small, explicit inputs to follow the calculation.
import json positive = [8, 8, 8, 8] negative = [2, 2, 2, 2] threshold = 202. Compare rectangular sums
This tiny Haar-like contrast example subtracts two equal-area region sums and applies a demonstration cutoff. It is not a trained detector or the full lesson’s normalized feature score.
response = sum(positive) - sum(negative) result = {"response": response, "pass": abs(response) >= threshold}3. Inspect the result
Print the result as JSON so both languages use the same output format.
print(json.dumps(result))
Expected result
Running the three cells in order produces this result in either language.
{
"response": 24,
"pass": true
}