For each slot, picks the largest of (alpha, beta[, gamma]) and
sets it to 1, the others to 0. Recovers the discrete grammar choice
at every slot. After snapping, evaluating the master should reproduce
the corresponding closed-form symbolic expression.
Details
This is meaningful only when par is a per-slot simplex (the
softmax output used by eml_fit() with parameterization = "simplex"), where the argmax corresponds to a grammar choice
{1, x, f}. Applied to raw continuous coefficients ("direct" mode)
the argmax has no such interpretation.
See also
Other eml_master:
build_master(),
eml_fit(),
master_n_params(),
theta_for_exp(),
theta_for_log(),
unpack_master_params()
Examples
theta <- theta_for_exp()
snapped <- snap_master_params(theta, depth = 1)
identical(snapped, theta) # already one-hot
#> [1] TRUE
