VariableSelectionNetwork#
- class pytorch_forecasting.models.temporal_fusion_transformer.sub_modules.VariableSelectionNetwork(input_sizes: Dict[str, int], hidden_size: int, input_embedding_flags: Dict[str, bool] = None, dropout: float = 0.1, context_size: int = None, single_variable_grns: Dict[str, GatedResidualNetwork] = None, prescalers: Dict[str, Linear] = None)[source]#
Bases:
Module
Calculate weights for
num_inputs
variables which are each of sizeinput_size
Methods
forward
(x[, context])Define the computation performed at every call.
- forward(x: Dict[str, Tensor], context: Tensor = 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.