Distributions
Distribution
Base class for all distributions.
Source code in models/tts/styledtts2/diffusion/distributions.py
9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
__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
12 13 14 15 16 17 18 19 20 21 |
|
LogNormalDistribution
Bases: Distribution
Log-normal distribution.
Source code in models/tts/styledtts2/diffusion/distributions.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
__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
37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
__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
27 28 29 30 31 32 33 34 35 |
|
UniformDistribution
Bases: Distribution
Uniform distribution.
Source code in models/tts/styledtts2/diffusion/distributions.py
52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__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
55 56 57 58 59 60 61 62 63 64 |
|
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
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
__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
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
__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
|
Source code in models/tts/styledtts2/diffusion/distributions.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|