SHM
- class neuralhydrology.modelzoo.shm.SHM(cfg: Config)
Bases:
BaseConceptualModelModified version of SHM [1] hydrological model with dynamic parameterization.
The SHM receives the dynamic parameterization given by a deep learning model. This class has two properties which define the initial conditions of the internal states of the model (buckets) and the ranges in which the model parameters are allowed to vary during optimization.
- Parameters:
cfg (Config) – The run configuration.
References
- forward(x_conceptual: Tensor, lstm_out: Tensor) Dict[str, Tensor | Dict[str, Tensor]]
Performs forward pass on the SHM model.
In this forward pass, all elements of the batch are processed in parallel.
- Parameters:
x_conceptual (torch.Tensor) – Tensor of size [batch_size, time_steps, n_inputs]. The batch_size is associated with a certain basin and a certain prediction period. The time_steps refer to the number of time steps (e.g. days) that our conceptual model is going to be run for. The n_inputs refer to the dynamic forcings used to run the conceptual model (e.g. Precipitation, Temperature…)
lstm_out (torch.Tensor) – Tensor of size [batch_size, time_steps, n_parameters]. The tensor comes from the data-driven model and will be used to obtained the dynamic parameterization of the conceptual model
- Returns:
- y_hat: torch.Tensor
Simulated outflow
- parameters: Dict[str, torch.Tensor]
Dynamic parameterization of the conceptual model
- internal_states: Dict[str, torch.Tensor]]
Time-evolution of the internal states of the conceptual model
- Return type:
Dict[str, Union[torch.Tensor, Dict[str, torch.Tensor]]]
- property initial_states
- property parameter_ranges