Skip to main content

TryInferPartialSubbranchProbability

Trait TryInferPartialSubbranchProbability 

Source
pub trait TryInferPartialSubbranchProbability {
    // Required method
    fn try_infer_partial_subbranch_probability(&self) -> Option<f32>;
}
Expand description

Infers the probability of including each child sub-branch partially. The fraction is in [0..1], or None if we cannot guess.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl TryInferPartialSubbranchProbability for Skeleton

Infers the probability of including each child sub-branch partially.

Heuristic:

  • Suppose aggregator nodes typically include all children (prob=1.0),
  • while dispatch nodes typically pick exactly one child (prob=1 / child_count). We’ll gather a rough average of how many children are “included” in practice.

Implementation:

  1. For aggregator nodes => “all children used” => partial factor = 1.0
  2. For dispatch nodes => partial factor ~ (1 / child_count)
  3. Average these across aggregator & dispatch nodes.
  4. If no aggregator/dispatch present => return None.