model_upsample_network.Rd
Upscale the dimensions of a spectrogram. Pass the input through the UpsampleNetwork layer.
model_upsample_network(
upsample_scales,
n_res_block = 10,
n_freq = 128,
n_hidden = 128,
n_output = 128,
kernel_size = 5
)
the list of upsample scales.
the number of ResBlock in stack. (Default: 10
)
the number of bins in a spectrogram. (Default: 128
)
the number of hidden dimensions of resblock. (Default: 128
)
the number of output dimensions of melresnet. (Default: 128
)
the number of kernel size in the first Conv1d layer. (Default: 5
)
Tensor shape: (n_batch, n_freq, (n_time - kernel_size + 1) * total_scale), (n_batch, n_output, (n_time - kernel_size + 1) * total_scale) where total_scale is the product of all elements in upsample_scales.
forward param: specgram (Tensor): the input sequence to the UpsampleNetwork layer (n_batch, n_freq, n_time)
if(torch::torch_is_installed()) {
upsamplenetwork = model_upsample_network(upsample_scales=c(4, 4, 16))
input = torch::torch_rand (10, 128, 10) # a random spectrogram
output = upsamplenetwork (input) # shape: (10, 1536, 128), (10, 1536, 128)
}