mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
feat: verify the computed solution error probability
This commit is contained in:
@@ -471,6 +471,7 @@ fn assert_checks<W: UnsignedInteger>(
|
||||
|
||||
const BITS_CARRY: u64 = 1;
|
||||
const BITS_PADDING_WITHOUT_NOISE: u64 = 1;
|
||||
const REL_EPSILON_PROBA: f64 = 1.0 + 1e-8;
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
pub fn optimise_one<W: UnsignedInteger>(
|
||||
@@ -582,5 +583,10 @@ pub fn optimise_one<W: UnsignedInteger>(
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(sol) = state.best_solution {
|
||||
assert!(0.0 <= sol.p_error && sol.p_error <= 1.0);
|
||||
assert!(sol.p_error <= maximum_acceptable_error_probability * REL_EPSILON_PROBA);
|
||||
}
|
||||
|
||||
state
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user