Skip to content

stdlib/dpView source ↗

dp

3 items · generated by scribe fromstdlib/dp.fd· synced 2026-11-15

stdlib/dp3 items

Contents

dp_noise

Add Gaussian noise to a tensor for differential privacy. sigma = sqrt(2 * epsilon * sensitivity^2 / num_samples)

pub fn dp_noise(t: Tensor, sigma: f64) -> Tensor {

Parameters:

  • t: Tensor
  • sigma: f64

Returns: Tensor

Defined at line 10


gaussian_noise

Generate Gaussian noise tensor with given shape and sigma.

pub fn gaussian_noise(shape: Vec<i64>, sigma: f64) -> Tensor {

Parameters:

  • shape: Vec<i64>
  • sigma: f64

Returns: Tensor

Defined at line 15


dropout

Dropout: randomly zero elements with probability p, scale survivors.

pub fn dropout(t: Tensor, p: f64) -> Tensor {

Parameters:

  • t: Tensor
  • p: f64

Returns: Tensor

Defined at line 20


Generated by scribe, the Fides documentation generator