gradoptics.distributions.gaussian_distribution

class gradoptics.distributions.gaussian_distribution.GaussianDistribution(mean=0.0, std=1.0)

Bases: gradoptics.distributions.base_distribution.BaseDistribution

1D Gaussian Distribution.

__init__(mean=0.0, std=1.0)
Parameters
  • mean – mean of the distribution (float)

  • std – standard deviation of the distribution (float)

sample(nb_points, device='cpu')

Samples from the distribution

Parameters
  • nb_points – Number of points to sample (int)

  • device – The desired device of returned tensor (str). Default is 'cpu'

Returns

Sampled points (torch.tensor)

pdf(x)

Returns the pdf function evaluated at x

Parameters

x – Value where the pdf should be evaluated (torch.tensor)

Returns

The pdf function evaluated at x (torch.tensor)