Meta Models¶
-
class
flood_forecast.meta_models.merging_model.
MergingModel
(method: str, other_params: Dict)[source]¶ -
__init__
(method: str, other_params: Dict)[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
training
: bool¶
-
-
class
flood_forecast.meta_models.merging_model.
Concatenation
(cat_dim: int, repeat: bool = True, use_layer: bool = False, combined_shape: int = 1, out_shape: int = 1)[source]¶ -
__init__
(cat_dim: int, repeat: bool = True, use_layer: bool = False, combined_shape: int = 1, out_shape: int = 1)[source]¶ - Args:
combined_shape int: The shape of the combined tensor along the cat dim out_shape int: The dimension of the outshape cat_dim int: The dimension to concatenate along
Examples: s
-
forward
(temporal_data: torch.Tensor, meta_data: torch.Tensor) → torch.Tensor[source]¶ - Args:
temporal_data: (batch_size, seq_len, d_model) meta_data (batch_size, d_embedding)
-
training
: bool¶
-
-
class
flood_forecast.meta_models.merging_model.
MultiModalSelfAttention
(d_model: int, n_heads: int, dropout: float)[source]¶ -
__init__
(d_model: int, n_heads: int, dropout: float)[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
forward
(temporal_data: torch.Tensor, meta_data) → torch.Tensor[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
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training
: bool¶
-