Read the equation
Flattened token representations h are multiplied by the transpose of the gate weight matrix, giving one raw routing logit per expert. Both operands are cast to float32. None means this linear operation adds no bias; the separate correction bias is added later for expert selection.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| h | T by 7168 token-state matrix |
| logits | T by 256 routing logits in this DeepSeek configuration |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
Input: hidden states h, shape (T, 7168) after flattening batch and sequence.
1. logits = F.linear( h.float32 , gate.weight.float32 , None ) -> (T, 256)
Both operands explicitly cast to float32 although gate.weight is BF16.
2. scores = sigmoid(logits) -> (T, 256)
Sigmoid, not softmax. Scores do not sum to 1 and are not a distribution.Exact original notation
logits = F.linear( h.float32 , gate.weight.float32 , None ) -> (T, 256)
Related builds
Sources & provenance
logits = F.linear( h.float32 , gate.weight.float32 , None ) -> (T, 256)
logits = F.linear( h.float32 , gate.weight.float32 , None ) -> (T, 256)