gatohep.losses#
- gatohep.losses.high_bkg_uncertainty_penalty(bkg_sumsq, bkg_yields, rel_threshold=0.2)#
Penalize bins whose relative Monte Carlo uncertainty exceeds a threshold.
- Parameters:
bkg_sumsq (tf.Tensor) –
- A tensor of shape [ncat] representing the sum of squared weights
(w_i^2) in each bin.
bkg_yields (tf.Tensor) – A tensor of shape [ncat] representing the sum of weights (w_i) in each bin.
rel_threshold (float, optional) – The relative uncertainty threshold. Default is 0.2 (20%).
- Returns:
A scalar tensor representing the total penalty summed over all bins.
- Return type:
tf.Tensor
- gatohep.losses.low_bkg_penalty(bkg_yields, threshold=10.0)#
Compute a penalty for background yields below a specified threshold.
- Parameters:
bkg_yields (tf.Tensor) – A tensor of shape [ncat] representing the background yields in each category.
threshold (float, optional) – The minimum background yield threshold. Default is 10.0.
- Returns:
A scalar tensor representing the total penalty summed over all categories.
- Return type:
tf.Tensor