home/ atoms/ exp-sigmoid-amplitude-scaling

The exp_sigmoid nonlinearity maps network outputs to strictly positive amplitudes with a controllable range

Neural network outputs can be any real number, but synthesizer amplitudes must be strictly positive. DDSP’s exp_sigmoid(x) maps the reals to the interval [threshold, max_value] via max_value * sigmoid(x)^log(exponent) + threshold. The threshold (default 1e-7) prevents exact zeros that would cause log-of-zero errors in loss computations. The exponent (default 10) controls the nonlinear slope: the output changes by a factor of exponent for every unit change of x in the nonlinear regime, giving fine control over quiet amplitudes. This is the default scale_fn for all DDSP synthesizers and effects, allowing the decoder to output unconstrained tensors while guaranteeing valid amplitude controls.

Examples

import ddsp
amplitudes = ddsp.core.exp_sigmoid(network_output)  # Always > 0
# Configurable via gin:
# exp_sigmoid.exponent = 10.0
# exp_sigmoid.max_value = 2.0

Assessment

Why can’t a standard sigmoid be used for amplitude scaling in DDSP? What problem does the threshold parameter prevent?

“@gin.register def exp_sigmoid(x, exponent=10.0, max_value=2.0, threshold=1e-7): """Exponentiated Sigmoid pointwise nonlinearity.”
corpus · ddsp-differentiable-digital-signal-processing-magenta-code-c · chunk 15