PositionalEmbedding#
- class pytorch_forecasting.models.timexer.sub_modules.PositionalEmbedding(d_model, max_len=5000)[source]#
Bases:
ModulePositional embedding module for time series data. :param d_model: Dimension of the model. :type d_model: int :param max_len: Maximum length of the input sequence. Defaults to 5000. :type max_len: int
Initialize internal Module state, shared by both nn.Module and ScriptModule.
Methods
forward(x)Define the computation performed at every call.
- forward(x)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.