Skip to content

Commit 0052ea7

Browse files
committed
fix(handlers): EMAHandler warmup now respects custom name parameter
When attach() is called with a custom name (e.g. for GAN generators), the momentum warmup scheduler was hardcoded to write to engine.state.ema_momentum instead of engine.state.{name}. This meant warmup had no effect with custom names. Fix: pass the name parameter through to LambdaStateScheduler.
1 parent 7358a27 commit 0052ea7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ignite/handlers/ema_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def attach(
248248
setattr(engine.state, name, self.momentum)
249249

250250
if self._momentum_lambda_obj is not None:
251-
self.momentum_scheduler = LambdaStateScheduler(self._momentum_lambda_obj, param_name="ema_momentum")
251+
self.momentum_scheduler = LambdaStateScheduler(self._momentum_lambda_obj, param_name=name)
252252

253253
# first update the momentum and then update the EMA model
254254
self.momentum_scheduler.attach(engine, event)

0 commit comments

Comments
 (0)