Verified interview challenge
Streaming Entropy
Compute entropy from logits, then keep the calculation stable as the input arrives in blocks.
Unlock with Full AccessThe challenge
Begin with a NumPy entropy calculation and extend it to handle large positive and negative logits. Then process a stream of blocks with constant extra memory. The four parts share one Python file and a 60-minute timer, with an untimed practice mode also available.
What you'll practise
Entropy and softmax
Turn logits into a distribution and calculate its uncertainty.
Numerical stability
Preserve meaningful results when exponentials overflow or small probabilities underflow.
Streaming computation
Combine blocks into one result without storing the full input.
# Build on your implementation
# Run checks for the current part
# Full starter code includedRun your code to see results.