rsr.rsr.compute_deficits¶
- rsr.rsr.compute_deficits(cand_states, refs_states, kind, max_elems=16777216)[source]¶
Smallest componentwise violation of each candidate against a reference set.
- Parameters:
cand_states (
Tensor) –(n_cand, n_var)integer component-state vectors.refs_states (
Tensor) –(n_refs, n_var)integer reference-state coordinates, as returned byrefs_mat_to_states().kind (
str) –"upper"ford+, i.e.min_j sum_i relu(r_ji - x_i), or"lower"ford-, i.e.min_k sum_i relu(x_i - r_ki).max_elems (
int) – Soft cap on the number of elements materialised at once. The reference set is chunked to respect it, so peak memory stays bounded regardless ofn_refs.
- Return type:
Tensor- Returns:
(n_cand,)int64 tensor of deficits. Values are non-negative integers whenever the inputs are integers.