model_stretch2d {torchaudio} | R Documentation |
Stretch2d
Description
Upscale the frequency and time dimensions of a spectrogram. Pass the input through the Stretch2d layer.
Usage
model_stretch2d(time_scale, freq_scale)
Arguments
time_scale |
the scale factor in time dimension |
freq_scale |
the scale factor in frequency dimension |
Details
forward param: specgram (Tensor): the input sequence to the Stretch2d layer (..., n_freq, n_time).
Value
Tensor shape: (..., n_freq * freq_scale, n_time * time_scale)
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)
}
[Package torchaudio version 0.3.1 Index]