get_named_estep_params¶
- get_named_estep_params(module: Module, default: bool = False, exclude: Sequence[Parameter | Module] | None = None, prefix: str = '', recurse: bool = True, remove_duplicate=True) Iterator[tuple[str, Parameter]][source]¶
Returns an iterator over E-step parameters, yielding both the name of the parameter and the parameter itself.
- Parameters:
module (Module) – module from which to retrieve E-step parameters.
exclude (Sequence[nn.Parameter | nn.Module] | None) – Defaults to None.
default (bool, optional) – if unspecified parameters should default to E-step parameters. Defaults to False.
prefix (str, optional) – prefix to prepend to all parameter names. Defaults to “”.
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:
tuple[str, nn.Parameter] – tuple containing the name and parameter.
Note
Resolution is performed as follows:
if
_e_params_is defined and the identifier for a parameter is in_e_params_, then the parameter is included.if
_e_params_is not defined but_m_params_is, and the identifier is in_m_params_, then the parameter is excluded.if
_e_params_is not defined and_m_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
_e_params_from the given module’s class and all its superclasses.Note
The E-step parameters for a class that inherits from
Moduleare determined by the class attribute_e_params_, containing a list of attribute names.