asterion.messengers#

Messengers module.

Module Contents#

class dimension(name, size, coords=None, dim=None)[source]#

Bases: numpyro.primitives.Messenger

Context manager for a model dimension.

Parameters
  • name (str) – Name of the dimension.

  • size (int) – Size of the dimension.

  • coords (array_like, optional) – Coordinates for points in the dimension. Defaults to np.arange(size).

  • dim (int, optional) – Where to place the dimension. Defaults to -1 which corresponds to the rightmost dimension. Must be negative.

coords :numpy.ndarray#

Coordinates for the dimension.

Type

numpy.ndarray

dim :int#

Location in which to insert the dimension.

Type

int

process_message(self, msg)[source]#

Process the message.

Parameters

msg (dict) – Message.

Raises

ValueError – If the corresponding dimension of the site is of incorrect size.