trinity.buffer.selector.difficulty_estimator module#

class trinity.buffer.selector.difficulty_estimator.BaseBetaPREstimator(n: int, m: int = 16, lamb: float = 0.2, rho: float = 0.2)[source]#

Bases: object

__init__(n: int, m: int = 16, lamb: float = 0.2, rho: float = 0.2)[source]#

alpha_{t+1} = (1 - lamb) * alpha_t + (1 - rho) * bar{s} + rho * tilde{s} beta_{t+1} = (1 - lamb) beta_t + (1 - rho) * bar{f} + rho * tilde{f}

Parameters:
  • n (int) – number of tasks.

  • m (int) – repeat times per tasks.

  • timeout (lamb) – discount factor of historical estimation.

  • rho (float) – weight of pseudo counts.

n: int#
m: int#
lamb: float#
rho: float#
alphas: ndarray#
betas: ndarray#
set(alphas, betas)[source]#
update(ref_indices: List[int], ref_pass_rates: List[float])[source]#
predict_pr(rng=None, indices=None, do_sample=False)[source]#
equivalent_count(indices=None)[source]#
class trinity.buffer.selector.difficulty_estimator.InterpolationBetaPREstimator(features: ndarray, m: int, lamb, rho, cap_coef_update_discount=0.9, adaptive_rho=False)[source]#

Bases: BaseBetaPREstimator

__init__(features: ndarray, m: int, lamb, rho, cap_coef_update_discount=0.9, adaptive_rho=False)[source]#

alpha_{t+1} = (1 - lamb) * alpha_t + (1 - rho) * bar{s} + rho * tilde{s} beta_{t+1} = (1 - lamb) beta_t + (1 - rho) * bar{f} + rho * tilde{f}

Parameters:
  • n (int) – number of tasks.

  • m (int) – repeat times per tasks.

  • timeout (lamb) – discount factor of historical estimation.

  • rho (float) – weight of pseudo counts.

update(ref_indices: List[int], ref_pass_rates: List[float])[source]#