emmi_inference.models.modules.continuous_sincos_embed ===================================================== .. py:module:: emmi_inference.models.modules.continuous_sincos_embed Classes ------- .. autoapisummary:: emmi_inference.models.modules.continuous_sincos_embed.ContinuousSincosEmbed Module Contents --------------- .. py:class:: ContinuousSincosEmbed(dim, ndim, max_wavelength = 10000, assert_positive = True) Bases: :py:obj:`torch.nn.Module` Embedding layer for continuous coordinates using sine and cosine functions as used in transformers. This implementation is able to deal with arbitrary coordinate dimensions (e.g., 2D and 3D coordinate systems). :param dim: Dimensionality of the embedded input coordinates. :param ndim: Number of dimensions of the input domain. :param max_wavelength: Max length. Defaults to 10000. :param assert_positive: If true, assert if all input coordiantes are positive. Defaults to True. Initialize internal Module state, shared by both nn.Module and ScriptModule. .. py:attribute:: dim .. py:attribute:: ndim .. py:attribute:: ndim_padding .. py:attribute:: sincos_padding .. py:attribute:: max_wavelength :value: 10000 .. py:attribute:: padding .. py:attribute:: assert_positive :value: True .. py:method:: forward(coords) Forward method of the ContinuousSincosEmbed layer. :param coords: Tensor of coordinates. The shape of the tensor should be (batch size, number of points, coordinate dimension) or (number of points, coordinate dimension). :returns: Tensor with embedded coordinates.