Upscale the frequency and time dimensions of a spectrogram. Pass the input through the Stretch2d layer.

model_stretch2d(time_scale, freq_scale)

Arguments

time_scale

the scale factor in time dimension

freq_scale

the scale factor in frequency dimension

Value

Tensor shape: (..., n_freq * freq_scale, n_time * time_scale)

Details

forward param: specgram (Tensor): the input sequence to the Stretch2d layer (..., n_freq, n_time).

Examples

if(torch::torch_is_installed()) {
 stretch2d = model_stretch2d(time_scale=10, freq_scale=5)

 input = torch::torch_rand(10, 100, 512)  # a random spectrogram
 output = stretch2d(input)  # shape: (10, 500, 5120)
}