Gating multiply

Combine · node type · Mul

Multiplies two tensors element by element, letting one signal switch another on or off.

Also called Elementwise multiply, Mul, Hadamard product, Gate

Figure 1. Gating multiply inside Meadow animal brain, a real model in WeightSpace. The outlined node is Gating multiply; select any node for its shapes and parameters.

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.

Figure 2. The typed ports of Gating multiply, in the same format as every model drawing. Letters such as N or C stand for any size.

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