Commit f012c3b4 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

cleaning

parent 4b07087f
...@@ -310,10 +310,12 @@ def perform_second_seg(model, ...@@ -310,10 +310,12 @@ def perform_second_seg(model,
th_w = customize_threshold(scores, th_w) th_w = customize_threshold(scores, th_w)
# Run HAC clustering # 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, new_diar, cluster_dict, merge = s4d.clustering.hac_iv.hac_iv(initial_diar,
scores, scores,
threshold=th_w, threshold=th_w,
method=hac_method) 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 # Update the model names of i-vector
# reverse the cluster dict: # reverse the cluster dict:
......
...@@ -322,4 +322,4 @@ def customize_threshold(scores, th_w): ...@@ -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]) / ( th_w += (-0.5 * (numpy.log(gmm.weights_[:, None] ** 2 / var) - means ** 2 / var).dot([1, -1]) / (
means / var).dot([1, -1]))[0] means / var).dot([1, -1]))[0]
return th_w return th_w
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment