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] = {}, dropout: float = 0.1, context_size: int | None = None, single_variable_grns: Dict[str, GatedResidualNetwork] = {}, prescalers: Dict[str, Linear] = {})[source]#
Bases:
ModuleCalcualte weights for
num_inputsvariables which are each of sizeinput_sizeMethods
forward(x[, context])Defines the computation performed at every call.
- forward(x: Dict[str, Tensor], context: Tensor | None = None)[source]#
Defines 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.