Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ambuj Mehrish
sidekit
Commits
244a0de5
Commit
244a0de5
authored
Mar 29, 2021
by
Gaël Le Lan
Browse files
bugfix
parent
c324e7e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
nnet/xvector.py
View file @
244a0de5
...
...
@@ -520,7 +520,7 @@ class Xtractor(torch.nn.Module):
self
.
sequence_network
=
PreHalfResNet34
()
self
.
embedding_size
=
512
self
.
before_speaker_embedding
=
torch
.
nn
.
Linear
(
in_features
=
256
0
,
self
.
before_speaker_embedding
=
torch
.
nn
.
Linear
(
in_features
=
512
0
,
out_features
=
self
.
embedding_size
)
self
.
stat_pooling
=
AttentivePooling
(
256
,
80
)
...
...
@@ -1110,8 +1110,8 @@ def xtrain(speaker_number,
non_indices
=
torch
.
tril
(
~
mask
,
-
1
).
numpy
()
tar_non_ratio
=
numpy
.
sum
(
tar_indices
)
/
numpy
.
sum
(
non_indices
)
non_indices
*=
numpy
.
random
.
choice
([
False
,
True
],
size
=
non_indices
.
shape
,
p
=
[
1
-
tar_non_ratio
,
tar_non_ratio
])
tar_indices
*=
numpy
.
random
.
choice
([
False
,
True
],
size
=
tar_indices
.
shape
,
p
=
[
0.9
,
0.1
])
non_indices
*=
numpy
.
random
.
choice
([
False
,
True
],
size
=
non_indices
.
shape
,
p
=
[
0.9
,
0.1
])
#
tar_indices *= numpy.random.choice([False, True], size=tar_indices.shape, p=[0.9, 0.1])
#
non_indices *= numpy.random.choice([False, True], size=non_indices.shape, p=[0.9, 0.1])
logging
.
critical
(
"val tar count : {:d}, non count : {:d}"
.
format
(
numpy
.
sum
(
tar_indices
),
numpy
.
sum
(
non_indices
)))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment