Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fix transforms.functional.view_as_window_batch
We were applying `np.squeeze` to the batch viewed as windows, whenever the second dimension was 1, e.g. if `batch_window.shape = (1, 1, 257, 4000)`, where `shape[1] == 1`. This causes an error when we have a sample that is *less* than the window size that we pad, since we throw away *both* dimensions 1 and 2, and then the next transform adds a "channel" dimension *after* the frequency dimension. Note this only affects frame classification models on the validation step, because that is where we need to view a single sample as a batch of windows. Now we just *always* throw away the first dimension-- because it's *always* 1. A separate question is whether there's a more efficient way to do this, but this should fix the bug for now and lets us run evaluation with windows larger than the size of some of the samples (i.e. spectrograms whose number of time bins is less than the window size).
- Loading branch information