View source: R/approach_vaeac_torch_modules.R
vaeac_normal_parse_params | R Documentation |
Function that takes in the a tensor where the first half of the columns contains the means of the
normal distributions, while the latter half of the columns contains the standard deviations. The standard deviations
are clamped with min_sigma
to ensure stable results. If params
is of dimensions batch_size x 8, the function
will create 4 independent normal distributions for each of the observation (batch_size
observations in total).
vaeac_normal_parse_params(params, min_sigma = 1e-04)
params |
Tensor of dimension |
min_sigma |
For stability it might be desirable that the minimal sigma is not too close to zero. |
Take a Tensor (e.g. neural network output) and return a torch::distr_normal()
distribution.
This normal distribution is component-wise independent, and its dimensionality depends on the input shape.
First half of channels is mean (\mu
) of the distribution, the softplus of the second half is
std (\sigma
), so there is no restrictions on the input tensor. min_sigma
is the minimal value of
\sigma
. I.e., if the above softplus is less than min_sigma
, then \sigma
is clipped
from below with value min_sigma
. This regularization is required for the numerical stability and may
be considered as a neural network architecture choice without any change to the probabilistic model.
A torch::distr_normal()
distribution with the provided means and standard deviations.
Lars Henry Berge Olsen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.