Frequencies softmax maps network logits to Hz by weighting a log-spaced frequency grid
To predict sinusoidal frequencies from unconstrained neural network outputs, DDSP provides frequencies_softmax(): the network outputs a distribution over a grid of logarithmically-spaced frequency bins (hz_min to hz_max), and the weighted average gives a differentiable frequency estimate. The depth parameter adds multiple softmax components per sinusoid for finer resolution. This avoids the discontinuous argmax operation and ensures gradients flow through the frequency prediction. The alternative frequencies_sigmoid() sums multiple sigmoid components at geometrically-spaced frequency scales.
Examples
# Logits from network -> frequencies in Hz
f_hz = ddsp.core.frequencies_softmax(
network_logits, # [batch, time, n_sinusoids * depth]
depth=64,
hz_min=20.0,
hz_max=8000.0)
Assessment
Why can’t you use argmax to extract the predicted frequency from a softmax distribution during training? What does the depth parameter control?