SE-SSD icon indicating copy to clipboard operation
SE-SSD copied to clipboard

how to update ema variables in different models, such as a big model and a small model ;

Open qiuhui1991 opened this issue 3 years ago • 2 comments

qiuhui1991 avatar Jun 23 '22 08:06 qiuhui1991

def update_ema_variables(model, ema_model, global_step): alpha = min(1 - 1 / (global_step + 1), 0.999) for ema_param, param in zip(ema_model.parameters(), model.parameters()): ema_param.data.mul_(alpha).add_(1 - alpha, param.data)

in different model, the function update_ema_variables produced error

qiuhui1991 avatar Jun 23 '22 08:06 qiuhui1991

@qiuhui1991 Can you give the traceback for your produced error? I guess it may be related with the settings of model/ema_model.

Vegeta2020 avatar Jun 24 '22 05:06 Vegeta2020