Unverified Commit 6f9c14be authored by Caroline Chen's avatar Caroline Chen Committed by GitHub
Browse files

Update docs (#1567)

parent aec0e8c9
...@@ -54,11 +54,11 @@ class Spectrogram(torch.nn.Module): ...@@ -54,11 +54,11 @@ class Spectrogram(torch.nn.Module):
wkwargs (dict or None, optional): Arguments for window function. (Default: ``None``) wkwargs (dict or None, optional): Arguments for window function. (Default: ``None``)
center (bool, optional): whether to pad :attr:`waveform` on both sides so center (bool, optional): whether to pad :attr:`waveform` on both sides so
that the :math:`t`-th frame is centered at time :math:`t \times \text{hop\_length}`. that the :math:`t`-th frame is centered at time :math:`t \times \text{hop\_length}`.
Default: ``True`` (Default: ``True``)
pad_mode (string, optional): controls the padding method used when pad_mode (string, optional): controls the padding method used when
:attr:`center` is ``True``. Default: ``"reflect"`` :attr:`center` is ``True``. (Default: ``"reflect"``)
onesided (bool, optional): controls whether to return half of results to onesided (bool, optional): controls whether to return half of results to
avoid redundancy Default: ``True`` avoid redundancy (Default: ``True``)
return_complex (bool, optional): return_complex (bool, optional):
Indicates whether the resulting complex-valued Tensor should be represented with Indicates whether the resulting complex-valued Tensor should be represented with
native complex dtype, such as `torch.cfloat` and `torch.cdouble`, or real dtype native complex dtype, such as `torch.cfloat` and `torch.cdouble`, or real dtype
...@@ -345,7 +345,7 @@ class InverseMelScale(torch.nn.Module): ...@@ -345,7 +345,7 @@ class InverseMelScale(torch.nn.Module):
tolerance_change (float, optional): Difference in losses to stop optimization at. (Default: ``1e-8``) tolerance_change (float, optional): Difference in losses to stop optimization at. (Default: ``1e-8``)
sgdargs (dict or None, optional): Arguments for the SGD optimizer. (Default: ``None``) sgdargs (dict or None, optional): Arguments for the SGD optimizer. (Default: ``None``)
norm (Optional[str]): If 'slaney', divide the triangular mel weights by the width of the mel band norm (Optional[str]): If 'slaney', divide the triangular mel weights by the width of the mel band
(area normalization). (Default: ``None``) (area normalization). (Default: ``None``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``) mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
""" """
__constants__ = ['n_stft', 'n_mels', 'sample_rate', 'f_min', 'f_max', 'max_iter', 'tolerance_loss', __constants__ = ['n_stft', 'n_mels', 'sample_rate', 'f_min', 'f_max', 'max_iter', 'tolerance_loss',
...@@ -436,25 +436,28 @@ class MelSpectrogram(torch.nn.Module): ...@@ -436,25 +436,28 @@ class MelSpectrogram(torch.nn.Module):
Args: Args:
sample_rate (int, optional): Sample rate of audio signal. (Default: ``16000``) sample_rate (int, optional): Sample rate of audio signal. (Default: ``16000``)
n_fft (int, optional): Size of FFT, creates ``n_fft // 2 + 1`` bins. (Default: ``400``)
win_length (int or None, optional): Window size. (Default: ``n_fft``) win_length (int or None, optional): Window size. (Default: ``n_fft``)
hop_length (int or None, optional): Length of hop between STFT windows. (Default: ``win_length // 2``) hop_length (int or None, optional): Length of hop between STFT windows. (Default: ``win_length // 2``)
n_fft (int, optional): Size of FFT, creates ``n_fft // 2 + 1`` bins. (Default: ``400``)
f_min (float, optional): Minimum frequency. (Default: ``0.``) f_min (float, optional): Minimum frequency. (Default: ``0.``)
f_max (float or None, optional): Maximum frequency. (Default: ``None``) f_max (float or None, optional): Maximum frequency. (Default: ``None``)
pad (int, optional): Two sided padding of signal. (Default: ``0``) pad (int, optional): Two sided padding of signal. (Default: ``0``)
n_mels (int, optional): Number of mel filterbanks. (Default: ``128``) n_mels (int, optional): Number of mel filterbanks. (Default: ``128``)
window_fn (Callable[..., Tensor], optional): A function to create a window tensor window_fn (Callable[..., Tensor], optional): A function to create a window tensor
that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``) that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``)
power (float, optional): Exponent for the magnitude spectrogram,
(must be > 0) e.g., 1 for energy, 2 for power, etc. (Default: ``2``)
normalized (bool, optional): Whether to normalize by magnitude after stft. (Default: ``False``)
wkwargs (Dict[..., ...] or None, optional): Arguments for window function. (Default: ``None``) wkwargs (Dict[..., ...] or None, optional): Arguments for window function. (Default: ``None``)
center (bool, optional): whether to pad :attr:`waveform` on both sides so center (bool, optional): whether to pad :attr:`waveform` on both sides so
that the :math:`t`-th frame is centered at time :math:`t \times \text{hop\_length}`. that the :math:`t`-th frame is centered at time :math:`t \times \text{hop\_length}`.
Default: ``True`` (Default: ``True``)
pad_mode (string, optional): controls the padding method used when pad_mode (string, optional): controls the padding method used when
:attr:`center` is ``True``. Default: ``"reflect"`` :attr:`center` is ``True``. (Default: ``"reflect"``)
onesided (bool, optional): controls whether to return half of results to onesided (bool, optional): controls whether to return half of results to
avoid redundancy. Default: ``True`` avoid redundancy. (Default: ``True``)
norm (Optional[str]): If 'slaney', divide the triangular mel weights by the width of the mel band norm (Optional[str]): If 'slaney', divide the triangular mel weights by the width of the mel band
(area normalization). (Default: ``None``) (area normalization). (Default: ``None``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``) mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
Example Example
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment