reparametrize
reparametrize
¶
reparametrize
¶
Reparametrization trick from Bayes by backprop: sample from N(mu, var) and still do backpropagation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
Tensor
|
Mean of the latent distribution, shape (batch, latent_dim). |
required |
logvar
|
Tensor
|
Log variance of the latent distribution, shape (batch, latent_dim). |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
Sampled latent vector, shape (batch, latent_dim). |