Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ivectorbin/agglomerative-cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) {
" is less than this threshold.");
po.Register("read-costs", &read_costs, "If true, the first"
" argument is interpreted as a matrix of costs rather than a"
"similarity matrix.");
" similarity matrix.");

po.Read(argc, argv);

Expand All @@ -75,6 +75,8 @@ int main(int argc, char *argv[]) {
RandomAccessInt32Reader reco2num_spk_reader(reco2num_spk_rspecifier);
Int32Writer label_writer(label_wspecifier);

if (!read_costs)
threshold = -threshold;
for (; !scores_reader.Done(); scores_reader.Next()) {
std::string reco = scores_reader.Key();
Matrix<BaseFloat> costs = scores_reader.Value();
Expand All @@ -84,7 +86,6 @@ int main(int argc, char *argv[]) {
// clustering code requires.
if (!read_costs)
costs.Scale(-1);
threshold = -threshold;
std::vector<std::string> uttlist = reco2utt_reader.Value(reco);
std::vector<int32> spk_ids;
if (reco2num_spk_rspecifier.size()) {
Expand Down