SoftmaxCategoricalConverter#
- class sdm.prior.SoftmaxCategoricalConverter(output_mode: str | HP[str], sample_categories: bool | HP[bool] = True, temperature: HP[float] | Correlated[float] | float | None = None, argmax_prob: float = 0.0, argmax_bias_floor: HP[float] | Correlated[float] | None = None, *, root_sampler: RootSampler | None = None, random_fn: RandomFunction | None = None)#
Bases:
CategoricalConverterConvert latent channels to category indices with softmax or argmax.
Each channel is standardized over rows, scaled, and given a random category bias. Categories are sampled from softmax probabilities or selected by argmax.
- Parameters:
output_mode (str | HP[str]) – Representation passed to child nodes.
"identity"keeps input slices,"index"repeats category indices across channels, and"embedding"supplies random category embeddings.sample_categories (bool | HP[bool]) – Whether to sample categories rather than take the argmax.
temperature (HP[float] | Correlated[float] | float | None) – Logit multiplier. Defaults to
Correlated(LogUniform(0.1, 10.0)).argmax_prob (float) – Probability of overriding
sample_categorieswith argmax using category biases floored at-argmax_bias_floor.argmax_bias_floor (HP[float] | Correlated[float] | None) – Sampler for the magnitude of the negative bias floor. Defaults to
Correlated(LogUniform(0.5, 6.0)).root_sampler (RootSampler | None) – Initial values for category embeddings. Required for
"embedding"output mode.random_fn (RandomFunction | None) – Random function applied to category embeddings. Required for
"embedding"output mode.