chainer.functions.gaussian¶
-
chainer.functions.gaussian(mean, ln_var, *, eps=None, return_eps=False)[source]¶ Gaussian sampling function.
This function takes a mean \(\mu\) and the logarithm of a variance \(\log(\sigma^2)\) as inputs and outputs a sample drawn from a Gaussian distribution \(N(\mu, \sigma)\).
The inputs must have the same shape.
- Parameters
mean (
Variableor N-dimensional array) – Input variable representing the mean \(\mu\).ln_var (
Variableor N-dimensional array) – Input variable representing the logarithm of a variance \(\log(\sigma^2)\).eps (N-dimensional array or None) – The eps value to be used. You do not have to specify this value, unless you need to make results deterministic. If
epsis not specified or set toNone, an eps value will be generated randomly. The shape and dtype must be the same asln_varand should be on the same device.return_eps (bool) – If
True, the eps value used in this function is returned together with the output variable. The returned eps can later be reused by passing it to theepsargument.
- Returns
When
return_epsisFalse(default), returns the output variable with the shape ofmeanand/orln_var. WhenTrue, returns the tuple of the output variable and eps (N-dimensional array). The eps will be on the same device as the input (ln_var).- Return type