sup3r.utilities.utilities.weighted_time_sampler
- weighted_time_sampler(data, shape, weights)[source]
Extracts a temporal slice from data with selection weighted based on provided weights
- Parameters:
data (np.ndarray) – Data array with dimensions (spatial_1, spatial_2, temporal, features)
shape (tuple) – (time_steps) Size of time slice to sample from data
weights (list) – List of weights used to specify selection strategy. e.g. If weights is [0.2, 0.8] then the start of the temporal slice will be selected from the first half of the temporal extent with 0.8 probability and 0.2 probability for the second half.
- Returns:
slice (slice) – time slice with size shape