googlehydrology.utils.cmal_deterministic module
Generates representative point predictions from CMAL head parameters.
This method is a deterministic alternative to random sampling CMAL, where there’s memory constraints on GPU and/or CPU. It takes 10 representative points from the predictive dist, and searches for quantiles. 10 points are 9 quantiles from 0.1 to 0.9 and a statistical mean of mixture dist.
When n_samples is low, this algorithm should serve as a better approximation.
- googlehydrology.utils.cmal_deterministic.generate_predictions(mu: Tensor, b: Tensor, tau: Tensor, pi: Tensor) Tensor
Generates predictions from a CMAL head: the dist mean followed by 9 quantiles.
Calculates mean of mixture dists and quantiles as a summary of predicting dist.
- Parameters:
mu – location parameter
b – scale parameter
tau – asymmetry parameter
pi – mixture weights
- Returns:
Summary dist where last dim has the dist mean followed by calculated quantiles.