Skip to content

[Feature] Add probability gate to variable masking configs#1339

Open
yyexela wants to merge 2 commits into
mainfrom
feature/var_masking_no_mask
Open

[Feature] Add probability gate to variable masking configs#1339
yyexela wants to merge 2 commits into
mainfrom
feature/var_masking_no_mask

Conversation

@yyexela

@yyexela yyexela commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Variable masking (#1329) drops input channels during training, but a UniformMaskingConfig scheme fired on every step. This PR adds a probability gate to UniformMaskingConfig so a uniform scheme can leave all channels intact on a fraction of steps.

At probability=1.0 (default) the gate always fires the draw, preserving current behavior. At 0.5 the scheme drops nothing on half the steps. The gate short-circuits at probability=1.0 so no gate draw is taken, keeping the RNG stream (and existing regression baselines) identical for configs that omit the field.

No probability gate is offered on BernoulliMaskingConfig: gating a Bernoulli pool at probability is identical to scaling rate by probability, so it would be redundant.

Changes:

  • fme.core.var_masking.UniformMaskingConfig / UniformMaskingGenerator: add probability: float = 1.0 field (gate), validated in [0, 1] via _validate_probability, threaded through build(). _validate_probability rejects bool explicitly, since bool is an int subclass that would otherwise coerce to 0.0/1.0.

  • fme.core.var_masking.BernoulliMaskingConfig: no gate (redundant with rate).

  • Tests added

  • If dependencies changed, "deps only" image rebuilt and "latest_deps_only_image.txt" file updated

yyexela added 2 commits July 2, 2026 13:18
Add a probability field to UniformMaskingConfig so a uniform scheme
leaves all channels intact on a fraction of steps. With probability
1 - probability the scheme fires no draw and drops nothing; at
probability=1.0 (default) the gate short-circuits so no gate draw is
taken, keeping the RNG stream identical to configs that omit the field.

No gate is offered on BernoulliMaskingConfig: gating a Bernoulli pool at
probability is identical to scaling rate by probability, so it would be
redundant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant