mixle.stats.compute.backend module

Generic backend scoring dispatch over distribution-owned math hooks.

exception BackendScoringError[source]

Bases: NotImplementedError

Raised when a distribution has no backend scoring hook.

child_seq_update(accumulator, enc, weights, estimate, engine)[source]

Route a child accumulator’s E-step through the active engine when possible.

Structural distributions (sequence, composite, optional, …) delegate accumulation to child accumulators. When the engine prefers staying resident (resident_estep) this uses the child’s seq_update_engine so nested families stay engine-resident; otherwise it falls back to the host seq_update with numpy weights. This is the recursion that pushes engine residency down a model tree.

Parameters:
  • accumulator (Any)

  • enc (Any)

  • weights (Any)

  • estimate (Any)

  • engine (ComputeEngine)

Return type:

None

backend_seq_log_density(dist, enc, engine=NUMPY_ENGINE)[source]

Return per-row log densities using engine and distribution-local math.

Parameters:
  • dist (Any)

  • enc (Any)

  • engine (ComputeEngine)

Return type:

Any

backend_seq_component_log_density(dist, enc, engine=NUMPY_ENGINE)[source]

Return component log densities when a distribution exposes them.

Parameters:
  • dist (Any)

  • enc (Any)

  • engine (ComputeEngine)

Return type:

Any

backend_log_density_sum(dist, enc, engine=NUMPY_ENGINE)[source]

Return the total log likelihood for one encoded payload.

Parameters:
  • dist (Any)

  • enc (Any)

  • engine (ComputeEngine)

Return type:

Any