Skip to content

← bayesian package

BNAFApprox

A powerful variational approximation of the posterior using block-neural autoregressive flows (BNAF).

This is a comparatively flexible, yet parameter-efficient approximation of the posterior that can capture non-Gaussian, skewed, and possibly multimodal distributions (within limits). The method works by transforming a simple distribution (e.g., a unit Gaussian) into the posterior distribution by a series of invertible transformations. Since the underlying model is a type of neural network, it might be necessary to experiment with the choice of the optimizer and its learning rate to avoid issues with convergence. More Info... Version 1.0.0

Ports/Properties

num_flows

The number of flows to use. The number is best experimentally determined, where 5-10 flows are often a good starting point. In ML settings such parameters can in principle be set using the Parameter Optimziation node, but this will only be practical in cases where inference is very fast.

  • verbose name: Num Flows
  • default value: 1
  • port type: IntPort
  • value type: int (can be None)

hidden_units

Number of hidden units per layer. The number of layers is determined by the length of the list, and the number of units per layer is determined by the values in the list. Good values are dependent on the dimensionality of the posterior N (sum of dimensions of all latent variables), and may be on the order of 2N to 10N.

  • verbose name: Hidden Units
  • default value: [8, 8]
  • port type: ListPort
  • value type: list (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)