Skip to content

← bayesian package

LogProbabilityTerm

Insert an additive term into the log probability of the ambient statistical model.

This is equivalent to a multiplicative factor in the model's probability density (or mass) function. This can be used as a shorthand for a perhaps much more complicated calculation or (set of) Random Draw statements involving distributions that may not be directly supported by NeuroPype Implementation-wise this is equivalent to a Random Draw from a special dummy distribution that returns the desired log-probability value. Version 0.9.0

Ports/Properties

log_term

Value of the term (in log space). The corresponding exponentiated value factors into the probability density (or mass) function of the model.

  • verbose name: Log Term
  • default value: None
  • port type: Port
  • value type: AnyNumeric (can be None)

varname

Name of the factor, for bookkeeping during model analysis.

  • verbose name: Factor Name
  • default value: myfactor
  • port type: StringPort
  • value type: str (can be None)

desc

Description for the factor. This can be used to annotate the purpose/meaning of the factor in the context of a statistical model. This is often a single sentence.

  • verbose name: Description
  • default value:
  • port type: StringPort
  • value type: str (can be None)

verbose_name

Optional verbose name for the factor. Can be used for augmented human-readable output.

  • verbose name: Verbose Name
  • default value: None
  • port type: StringPort
  • value type: str (can be None)

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)

axis_pairing

How to pair axes of the inputs with respect to any ambient plates. In 'positional' mode, axes are paired by their position according to a right alignment, that is, the last axis of the first operand is paired with the last axis of the second operand, and so on, while any missing axes behave as if they were unnamed axes of length 1 (this is the same way plain n-dimensional arrays pair in Python/numpy). In 'matched' mode, axes are paired by their type and optionally label, where the axis order of the first operand is preserved in the output, optionally with additional axes that only occur in the second operand prepended on the left. The other operand then has its axes reordered to match. All axis classes are treated as distinct, except for the plain axis, which is treated as a wildcard axis that can pair with any other axis. See also the 'label_handling' property for how labels are treated in this mode. The 'default' value resolves to a value that may be overridden in special contexts (mainly the ambient Inference node) and otherwise resolves to the setting of the configuration variable default_axis_pairing, which is set to 'positional' in 2024.x. Note that axis pairing can be subtle, and it is recommended to not blindly trust that the default behavior is always what the user intended.

  • verbose name: Axis Pairing
  • default value: default
  • port type: EnumPort
  • value type: str (can be None)

label_pairing

How to treat axis labels when pairing axes in 'matched' mode. In 'always' mode, labels are always considered significant, and axes with different labels are always considered distinct, which means that, if the two operands each have an axis of same type but with different labels, each operand will have a singleton axis inserted to pair with the respective axis in the other operand. In 'ignore' mode, labels are entirely ignored when pairing axes; this means that, if multiple axes of the same type occur in one or more operands, the last space axis in the first operand is paired with the last space axis in the second operand, etc. as in positional mode. In 'auto' mode, labels are only considered significant if they are necessary for distinguishing two or more axes of the same type in any of the operands, or if they occur on a plain axis.

  • verbose name: Label Pairing
  • default value: auto
  • port type: EnumPort
  • value type: str (can be None)