ParameterGroup

class ParameterGroup(param_names, distribution=None)[source]

Bases: object

A metadata class that groups a set of named flat parameters and defines any relationships between them.

Variables:
  • parameter_names (list[str]) – The names of the parameters included in this group.

  • distribution (dist.Distribution or None) – An optional joint distribution over the flattened parameters.

Parameters:
param_names: list[str]
distribution: Distribution | None = None
property num_params

Number of flattened parameters in the group.

Returns:

The count of names in parameter_names.

Return type:

int

property min: array

The unscaled minimum value of the parameter group’s distribution.

Determined by the MIN_PERCENTILE quantile.

Returns:

The minimum value, or -inf if no distribution is set.

Return type:

jnp.array

property max: array

The unscaled maximum value of the parameter group’s distribution.

Determined by the MAX_PERCENTILE quantile.

Returns:

The maximum value, or inf if no distribution is set.

Return type:

jnp.array

with_distribution(distribution)[source]

Return a copy of the parameter group with a new distribution.

Parameters:

distribution (numpyro.distributions.Distribution) – The distribution to associate with this parameter.

Returns:

A copy of this object with distribution replaced.

Return type:

Parameter

Raises:

Exception – If dist is not a numpyro Distribution.