Skip to content

← distributions package

DistributionMode

Calculate the mthe mode (location of maximum value) of a provided (wired-in) probability distribution.

For univariate distributions, this is a scalar, but the value will be an array if the distribution's event space is multivariate, and/or if the distribution itself is batched, as in, is parameterized by a batch of parameters (e.g., multiple sets of locations or scales). In these cases, the shape of the result is (batch_shape, event_shape). For the distributions defined in the distributions package, this yields generally the analytic, i.e. exact, result, but is not available for all combinations of distributions and backends (good choices are scipy, tfp, or distrax, if your distribution is available for those backends). The mode is usually not directly available for sampling-based distributions (e.g., those output by one of the Inference nodes), but the mode of such a distribution can be obtained from the Variational Inference node if the approximation is set to MAP (maximum a posteriori) or Laplace. More Info... Version 1.0.0

Ports/Properties

dist

Distribution to use.

  • verbose name: Dist
  • default value: None
  • port type: DataPort
  • value type: Distribution (can be None)
  • data direction: IN

value

Resulting value.

  • verbose name: Value
  • default value: None
  • port type: DataPort
  • value type: object (can be None)
  • data direction: OUT

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)