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 if default is 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 Module are determined by the class attribute _e_params_, containing a list of attribute names.