neural_lam.models.latent.constant_encoder#
Constant (input-independent) latent encoder.
Classes#
Latent encoder that returns a constant (input-independent) distribution. |
Module Contents#
- class neural_lam.models.latent.constant_encoder.ConstantLatentEncoder(latent_dim: int, num_mesh_nodes: int, output_dist: str = 'isotropic')[source]#
Bases:
neural_lam.models.latent.base_encoder.BaseLatentEncoderLatent encoder that returns a constant (input-independent) distribution.
compute_dist_paramsreturns a tensor of zeros, so the resulting Normal isNormal(mean=0, std=1)foroutput_dist="isotropic"andNormal(mean=0, std=softplus(0)+eps)foroutput_dist="diagonal".Store the number of mesh nodes to produce parameters for.
- Parameters:
- compute_dist_params(grid_rep: torch.Tensor, **kwargs: Any) torch.Tensor[source]#
Compute raw distribution parameters from the grid representation.
For this constant encoder the parameters are all zeros, independent of the values in
grid_rep.- Parameters:
grid_rep (torch.Tensor) – Shape
(B, num_grid_nodes, d_h). Grid input representation, used only to determine batch size and device.**kwargs – Ignored; accepted for compatibility with the base class interface.
- Returns:
Shape
(B, num_mesh_nodes, output_dim). Raw parameters of the latent distribution, all zeros.- Return type:
- num_mesh_nodes#