ksuit.utils.model.model_utils¶
Functions¶
|
Copy parameters and buffers from source_model to target_model. |
|
Update the target model with an exponential moving average of the source model. |
Module Contents¶
- ksuit.utils.model.model_utils.copy_params(source_model, target_model)¶
Copy parameters and buffers from source_model to target_model.
- Parameters:
source_model (ksuit.models.model_base.ModelBase) – The model to copy parameters from.
target_model (ksuit.models.model_base.ModelBase) – The model to copy parameters to.
- Return type:
None
- ksuit.utils.model.model_utils.update_ema(source_model, target_model, target_factor, copy_buffers=False)¶
Update the target model with an exponential moving average of the source model.
- Parameters:
source_model (ksuit.models.model_base.ModelBase) – The source model to copy parameters from.
target_model (ksuit.models.model_base.ModelBase) – The target model to update.
target_factor (float) – The factor to use for the exponential moving average.
copy_buffers (bool) – Whether to copy buffers as well. Defaults to False.
- Return type:
None