What it does
An elementwise multiply scales each value of one tensor by the matching value of another. When one side comes out of a sigmoid or softmax, it acts as a gate: values near 0 block the signal and values near 1 pass it. LSTM and GRU cells, squeeze-and-excitation blocks, gated linear units and the gated mixers of TinyTimeMixer all rely on this. Plain Mul nodes also appear in graphs for fixed scaling (such as 1/√d in attention) and as half of the swish activation.
Formula
y = a ⊙ b, yi = ai · bigated: y = x ⊙ σ(W x + b)Shapes and parameters
- Shapes
- Two tensors of the same shape (or broadcastable) in, the same shape out.
- Parameters
- None for the multiply. The gate’s own layer has its parameters.
- Used for
- Recurrent cells, attention-style channel gates, gated MLP mixers, swish and GELU decompositions.
In WeightSpace
Read-only in WeightSpace today. In the Meadow animals each drive’s steering vector is scaled by its sigmoid activation and an editable gain, a hand-written version of this idea.
Where it appears
- Dream up an empty roomNanoDreamer6225M params
- Find text regions on an imagePP-OCRv5 Mobile Detection531.2M params
- Change how a voice speakstiny-voca484.5M params
- Find the most relevant answerall-MiniLM-L6-v23723M params
- Cut out a portraitMODNet366.5M params
- Track motion between two framesRAFT-Small17990K params
- Forecast a time seriesGranite TinyTimeMixer R216805K params
- Name the emotion in a sentenceALBERT Base v2 Emotion1512M params
- Generate a frame between two photosPractical-RIFE 4.25145.7M params
- Translate a Chinese sentenceHelsinki-NLP OPUS-MT11111M params
- Restore punctuation in a transcriptEdge-Punct-Casing107.4M params
- Rerank search resultsMS MARCO TinyBERT-L294.4M params
- Transcribe a short English recordingWav2Vec2 Base 960h994M params
- Find video shot changesTransNetV277.6M params
- Remove background noiseGTCRN748K params
- Detect speech in a recordingSilero VAD6545K params
- Read a phrase aloudKokoro 82M681M params
- Ask a question about a tableGoogle TAPAS Tiny54.5M params
- Find beats and downbeatsBeat This! Small53.2M params
- Classify text with your labelsXtremeDistil zero-shot313M params
- Track a subject between framesOpenCV VitTrack3174K params
- Find an answer in a passageDistilBERT SQuAD265M params
- Find rows and cells in a tablePaddleOCR SLANet+21.9M params
- Segment an object by clickingSlimSAM29.7M params
- Track the pitch of a soundCREPE Tiny2487K params
- Transcribe music into notesSpotify Basic Pitch236K params
- Estimate depth from a photoDepth Anything V2 Small125M params
- Find a caption that fits a photoTinyCLIP ViT-8M/16123M params
- Meadow animal brainWeightSpace ecosystem brain142 params
- Recognize sounds in a recordingYAMNet14.0M params