sup3r.preprocessing.samplers.utilities.weighted_time_sampler#
- weighted_time_sampler(data_shape, sample_shape, weights)[source]#
Returns a temporal slice with selection weighted based on provided weights used to extract temporal chunk from data
- Parameters:
data_shape (tuple) – (rows, cols, n_steps) Size of full spatiotemporal data grid available for sampling
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