pub struct AcceptanceCalibration {
pub drafter: DrafterKey,
/* private fields */
}Expand description
2026-10-04: How likely a draft is to be accepted, from the drafter’s top-1 log-probability
for it, fitted on one drafter (DrafterKey); and per-position priors for drafts whose
confidence was not measured. A draft is accepted only if every draft before it was, so a
chain’s expected accepted length is the sum of the running products.
Fields§
§drafter: DrafterKeyImplementations§
Source§impl AcceptanceCalibration
impl AcceptanceCalibration
Sourcepub fn fit(
drafter: DrafterKey,
edges: &[f32],
accepted: &[u64],
rejected: &[u64],
steps: &BTreeMap<(usize, usize), u64>,
) -> Result<Self, String>
pub fn fit( drafter: DrafterKey, edges: &[f32], accepted: &[u64], rejected: &[u64], steps: &BTreeMap<(usize, usize), u64>, ) -> Result<Self, String>
2026-10-04: The calibration of drafter from per-bucket reached-draft outcomes
(edges ascending, accepted[i] and rejected[i] in bucket i) and verify steps by
(drafts, accepted).
Source§impl AcceptanceCalibration
impl AcceptanceCalibration
Sourcepub fn parse(text: &str) -> Result<Self, String>
pub fn parse(text: &str) -> Result<Self, String>
2026-10-04: Parses and validates a calibration file: as many probabilities as edges, edges strictly ascending with the last at least 0, every probability in 0..=1, at least one position prior.
Sourcepub fn p_given_lp(&self, lp: f32) -> f64
pub fn p_given_lp(&self, lp: f32) -> f64
2026-10-04: P(accept) of a draft whose top-1 log-probability is lp.
Sourcepub fn prior(&self, j: usize) -> f64
pub fn prior(&self, j: usize) -> f64
2026-10-04: The prior for draft position j (1-based); positions past the last
fitted one take the last prior.
Sourcepub fn expected_accepted(&self, lps: &[f32], k: usize) -> f64
pub fn expected_accepted(&self, lps: &[f32], k: usize) -> f64
2026-10-04: Expected accepted drafts of a chain whose drafts have confidences lps
(missing entries take the position prior), counting only the first k.
Trait Implementations§
Source§impl Clone for AcceptanceCalibration
impl Clone for AcceptanceCalibration
Source§fn clone(&self) -> AcceptanceCalibration
fn clone(&self) -> AcceptanceCalibration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more