vak.datasets.frame_classification.window_dataset.get_window_inds#

vak.datasets.frame_classification.window_dataset.get_window_inds(n_frames: int, window_size: int, stride: int = 1)[source]#

Get indices of windows for a WindowDataset, given the number of frames in the dataset, the window size, and the stride.

This function is used by WindowDataset to compute the indices of windows in the dataset. The length of the vector of indices it returns is the number of windows in the dataset, i.e., the number of samples.

Parameters:
  • n_frames (int) –

  • window_size (int) –

  • stride (int) –

Returns:

window_inds – Vector of indices for windows. During training, batches of windows are made by grabbing indices randomly from this vector, then getting windows of the specified size from the arrays representing the input data and targets for the neural network.

Return type:

numpy.ndarray