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
evALLIES
Commits
f012c3b4
Commit
f012c3b4
authored
May 25, 2021
by
Anthony Larcher
Browse files
cleaning
parent
4b07087f
Changes
2
Hide whitespace changes
Inline
Side-by-side
lium_baseline/system.py
View file @
f012c3b4
...
...
@@ -310,10 +310,12 @@ def perform_second_seg(model,
th_w
=
customize_threshold
(
scores
,
th_w
)
# Run HAC clustering
print
(
f
"Avant HAC : len(diar)=
{
len
(
initial_diar
.
unique
(
'cluster'
))
}
, min et max scores:
{
scores
.
scoremat
.
min
()
}
et
{
scores
.
scoremat
.
max
()
}
, th =
{
th_w
}
"
)
new_diar
,
cluster_dict
,
merge
=
s4d
.
clustering
.
hac_iv
.
hac_iv
(
initial_diar
,
scores
,
threshold
=
th_w
,
method
=
hac_method
)
print
(
f
"Apres HAC : len(diar)=
{
len
(
new_diar
.
unique
(
'cluster'
))
}
, min et max scores:
{
scores
.
scoremat
.
min
()
}
et
{
scores
.
scoremat
.
max
()
}
, th =
{
th_w
}
"
)
# Update the model names of i-vector
# reverse the cluster dict:
...
...
lium_baseline/utils.py
View file @
f012c3b4
...
...
@@ -322,4 +322,4 @@ def customize_threshold(scores, th_w):
th_w
+=
(
-
0.5
*
(
numpy
.
log
(
gmm
.
weights_
[:,
None
]
**
2
/
var
)
-
means
**
2
/
var
).
dot
([
1
,
-
1
])
/
(
means
/
var
).
dot
([
1
,
-
1
]))[
0
]
return
th_w
\ No newline at end of file
return
th_w
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