Encoder#

class pytorch_forecasting.models.timexer.sub_modules.Encoder(layers, norm_layer=None, projection=None)[source]#

Bases: Module

Encoder module for the TimeXer model. :param layers: List of encoder layers. :type layers: list :param norm_layer: Normalization layer. Defaults to None. :type norm_layer: nn.Module, optional :param projection: Projection layer. Defaults to None. :type projection: nn.Module, optional

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Methods

forward(x, cross[, x_mask, cross_mask, tau, ...])

Define the computation performed at every call.

forward(x, cross, x_mask=None, cross_mask=None, tau=None, delta=None)[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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.