A context vector is a fixed-size summary of item representations. In the attention network, hidden states h are combined into h_context before attention scores are computed. section 10.3
For padded variable-length inputs, average only valid items. Multiply h by the mask, sum across items, and divide by the valid-item count; add 1e-10 to avoid division by zero. section 10.3
