popgym.baselines.models.embeddings ================================== .. py:module:: popgym.baselines.models.embeddings Classes ------- .. autoapisummary:: popgym.baselines.models.embeddings.PhaserEncoding popgym.baselines.models.embeddings.ScaledPositionalEncoding popgym.baselines.models.embeddings.SimpleScaledEncoding popgym.baselines.models.embeddings.Time2Vec popgym.baselines.models.embeddings.Base2Embedding popgym.baselines.models.embeddings.PerceptronEmbedding popgym.baselines.models.embeddings.SoftExponentialEmbedding Functions --------- .. autoapisummary:: popgym.baselines.models.embeddings.positional_encoding Module Contents --------------- .. py:function:: positional_encoding(max_len, d_model) .. py:class:: PhaserEncoding(max_len: int, d_model: int, num_dims: int, max_period: int = 1024, dtype: torch.dtype = torch.double, decay_bias: float = -0.5, freq_scale: float = 1.0, fudge_factor: float = 0.025, soft_clamp: bool = False) Bases: :py:obj:`torch.nn.Module` .. py:attribute:: num_dims .. py:attribute:: d_model .. py:attribute:: dtype .. py:attribute:: limit .. py:attribute:: soft_clamp :value: False .. py:attribute:: c .. py:attribute:: d .. py:attribute:: ab .. py:method:: psi(t_minus_i) .. py:method:: recurrent_update2(x, state) .. py:method:: recurrent_update(x, state) .. py:method:: forward(x, state) .. py:class:: ScaledPositionalEncoding(num_embeddings, embedding_dim, **kwargs) Bases: :py:obj:`torch.nn.Embedding` .. py:attribute:: a .. py:method:: forward(idx) .. py:class:: SimpleScaledEncoding(max_len, d_model) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(idx) .. py:class:: Time2Vec(max_len, d_model) Bases: :py:obj:`torch.nn.Module` .. py:attribute:: d_model .. py:attribute:: max_len .. py:attribute:: net .. py:method:: forward(idx) .. py:class:: Base2Embedding(max_len, d_model) Bases: :py:obj:`torch.nn.Module` .. py:attribute:: d_model .. py:attribute:: max_len .. py:method:: forward(idx) .. py:class:: PerceptronEmbedding(max_len, d_model) Bases: :py:obj:`torch.nn.Module` .. py:attribute:: d_model .. py:attribute:: lin .. py:method:: forward(idx) .. py:class:: SoftExponentialEmbedding(max_len, d_model) Bases: :py:obj:`torch.nn.Module` .. py:attribute:: d_model .. py:attribute:: a .. py:attribute:: lin .. py:method:: forward(idx)