Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
enricobottazzi committed Feb 14, 2024
1 parent 8cd9f7f commit a7010ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core_crypto/guassian_sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ mod tests {

#[test]
fn gaussian_sampler_truncation_limit() {
// Assert that the samples are within the bounds of the truncated Gaussian distribution.
let sampler = GaussianSampler::new(SIGMA);

for _ in 0..(1 << 25) {
Expand All @@ -68,6 +69,7 @@ mod tests {

#[test]
fn gaussian_sampler_mean() {
// Assert that the mean of the samples is close to 0.
let sampler = GaussianSampler::new(SIGMA);

let mut sum = 0;
Expand All @@ -80,7 +82,9 @@ mod tests {
}

#[test]
fn gaussian_pmf_consistency() {
fn gaussian_sampler_pmf_consistency() {
// Assert that the probability mass function for a random `x` observed by performing sample on the `sampler`
// is consistent with the expected distribution.
let sampler = GaussianSampler::new(SIGMA);
let val = rand::thread_rng().gen_range(-sampler.params.bound..=sampler.params.bound);

Expand Down

0 comments on commit a7010ef

Please sign in to comment.