Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anthony Larcher
sidekit
Commits
a131c21a
Commit
a131c21a
authored
Apr 14, 2021
by
Anthony Larcher
Browse files
debug
parent
7f09fefa
Changes
1
Hide whitespace changes
Inline
Side-by-side
nnet/xsets.py
View file @
a131c21a
...
@@ -106,6 +106,10 @@ class SideSampler(torch.utils.data.Sampler):
...
@@ -106,6 +106,10 @@ class SideSampler(torch.utils.data.Sampler):
def
__iter__
(
self
):
def
__iter__
(
self
):
g
=
torch
.
Generator
()
g
.
manual_seed
(
self
.
seed
+
self
.
epoch
)
numpy
.
random
.
seed
(
self
.
seed
+
self
.
epoch
)
# Generate batches per speaker
# Generate batches per speaker
straight
=
numpy
.
arange
(
self
.
spk_count
)
straight
=
numpy
.
arange
(
self
.
spk_count
)
indices
=
numpy
.
ones
((
self
.
samples_per_speaker
,
self
.
spk_count
),
dtype
=
numpy
.
int
)
*
straight
indices
=
numpy
.
ones
((
self
.
samples_per_speaker
,
self
.
spk_count
),
dtype
=
numpy
.
int
)
*
straight
...
@@ -136,9 +140,6 @@ class SideSampler(torch.utils.data.Sampler):
...
@@ -136,9 +140,6 @@ class SideSampler(torch.utils.data.Sampler):
# we want to convert the speaker indexes into segment indexes
# we want to convert the speaker indexes into segment indexes
self
.
index_iterator
=
numpy
.
zeros_like
(
batch_matrix
)
self
.
index_iterator
=
numpy
.
zeros_like
(
batch_matrix
)
g
=
torch
.
Generator
()
g
.
manual_seed
(
self
.
seed
+
self
.
epoch
)
# keep track of next segment index to sample for each speaker
# keep track of next segment index to sample for each speaker
for
idx
,
value
in
enumerate
(
batch_matrix
):
for
idx
,
value
in
enumerate
(
batch_matrix
):
if
self
.
segment_cursors
[
value
]
>
len
(
self
.
labels_to_indices
[
value
])
-
1
:
if
self
.
segment_cursors
[
value
]
>
len
(
self
.
labels_to_indices
[
value
])
-
1
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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