Distributions
Distribution
Base class for all distributions.
Source code in models/tts/styledtts2/diffusion/distributions.py
__call__(num_samples)
Generate a number of samples from the distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_samples |
int
|
The number of samples to generate. |
required |
Raises:
Type | Description |
---|---|
NotImplementedError
|
This method should be overridden by subclasses. |
Source code in models/tts/styledtts2/diffusion/distributions.py
LogNormalDistribution
Bases: Distribution
Log-normal distribution.
Source code in models/tts/styledtts2/diffusion/distributions.py
__call__(num_samples)
Generate a number of samples from the log-normal distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_samples |
int
|
The number of samples to generate. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tensor |
Tensor
|
A tensor of samples from the log-normal distribution. |
Source code in models/tts/styledtts2/diffusion/distributions.py
__init__(mean, std)
Initialize the distribution with a mean and standard deviation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mean |
float
|
The mean of the log-normal distribution. |
required |
std |
float
|
The standard deviation of the log-normal distribution. |
required |
Source code in models/tts/styledtts2/diffusion/distributions.py
UniformDistribution
Bases: Distribution
Uniform distribution.
Source code in models/tts/styledtts2/diffusion/distributions.py
__call__(num_samples)
Generate a number of samples from the uniform distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_samples |
int
|
The number of samples to generate. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tensor |
A tensor of samples from the uniform distribution. |
Source code in models/tts/styledtts2/diffusion/distributions.py
VKDistribution
Bases: Distribution
VK distribution. The class is implementing a variant of a distribution that is based on the Von Mises distribution, which is a continuous probability distribution on the circle (it's often used as a circular version of the normal distribution).
Source code in models/tts/styledtts2/diffusion/distributions.py
__call__(num_samples)
Generate a number of samples from the VK distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
num_samples |
int
|
The number of samples to generate. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tensor |
Tensor
|
A tensor of samples from the VK distribution. |
Source code in models/tts/styledtts2/diffusion/distributions.py
__init__(min_value=0.0, max_value=float('inf'), sigma_data=1.0)
Initialize the distribution with a minimum value, maximum value, and sigma data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min_value |
float
|
The minimum value for the inverse CDF. Defaults to 0.0. |
0.0
|
max_value |
float
|
The maximum value for the inverse CDF. Defaults to infinity. |
float('inf')
|
sigma_data |
float
|
The sigma data of the VK distribution. Defaults to 1.0. |
1.0
|