model_stretch2d.Rd
Upscale the frequency and time dimensions of a spectrogram. Pass the input through the Stretch2d layer.
model_stretch2d(time_scale, freq_scale)
the scale factor in time dimension
the scale factor in frequency dimension
Tensor shape: (..., n_freq * freq_scale, n_time * time_scale)
forward param: specgram (Tensor): the input sequence to the Stretch2d layer (..., n_freq, n_time).
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)
}