Applies scaling to queries using two MLPs:
\(q_{\text{scaled}} = q \cdot \text{base\_mlp}(\log n) \cdot (1 + \tanh(\text{query\_mlp}(q)))\)
The base MLP learns length-dependent scaling while the query MLP learns query-dependent modulation. The query MLP is zero-initialised so that the initial modulation is the identity (\(1 + 0 = 1\)).
Value
An nn_module object (class generator).