att_guid
AttentionGuidance
Bases: Criterion
This criterion is the attention guidance loss function.
Efficiently trainable text-to-speech system based on deep convolutional networks with guided attention
https://arxiv.org/pdf/1710.08969
Source code in speechain/criterion/att_guid.py
__call__(att_tensor, x_len, y_len=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
att_tensor
|
Tensor
|
(batch, layer_num * head_num, max_xlen, max_ylen) |
required |
x_len
|
Tensor
|
(batch,) |
required |
y_len
|
Tensor
|
(batch,) = None |
None
|
Returns:
Source code in speechain/criterion/att_guid.py
criterion_init(sigma=0.2)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sigma
|
float
|
float = 0.2 The value of the sigma used to calculate the attention guidance loss. |
0.2
|
get_weight_matrix(X, Y)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
int
|
|
required |
Y
|
int
|
|
required |
Returns: