model_stretch2d | R Documentation |
Upscale the frequency and time dimensions of a spectrogram. Pass the input through the Stretch2d layer.
model_stretch2d(time_scale, freq_scale)
time_scale |
the scale factor in time dimension |
freq_scale |
the scale factor in frequency dimension |
forward param: specgram (Tensor): the input sequence to the Stretch2d layer (..., n_freq, n_time).
Tensor shape: (..., n_freq * freq_scale, n_time * time_scale)
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) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.