get_mstep_params¶
- get_mstep_params(module: Module, default: bool = True, exclude: Sequence[Parameter | Module] | None = None, recurse: bool = True) Iterator[Parameter][source]¶
Returns an iterator over M-step parameters.
- Parameters:
module (Module) – module from which to retrieve M-step parameters.
default (bool, optional) – if unspecified parameters should default to M-step parameters. Defaults to True.
exclude (Sequence[nn.Parameter | nn.Module] | None) – Defaults to None.
recurse (bool, optional) – if parameters that are not direct members should be included. Defaults to True.
remove_duplicate (bool, optional) – if duplicated parameters should be excluded. Defaults to True.
- Yields:
nn.Parameter – M-step parameter.
Note
Resolution is performed as follows:
if
_m_params_is defined and the identifier for a parameter is in_m_params_, then the parameter is included.if
_m_params_is not defined but_e_params_is, and the identifier is in_e_params_, then the parameter is excluded.if
_m_params_is not defined and_e_params_, if present, does not contain the identifier, then the parameter is included ifdefaultis true and excluded if it is false.
This resolution is performed on the combined
_m_params_from the given module’s class and all its superclasses.Note
The M-step parameters for a class that inherits from
Moduleare determined by the class attribute_m_params_, containing a list of attribute names.