Skip to content

Commit

Permalink
Print out some debug information
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongkaifu committed Sep 11, 2023
1 parent f1d5a6d commit a61fd87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion Seq2SeqSharp/Corpus/MonoCorpus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ public IEnumerator<T> GetEnumerator()
Logger.WriteLine($"Processing batch '{batchIdx}/{m_batchNumInTotal}'."); // The '{i}th' record in this batch is: Target = '{tgtLine}'");
currentBatchPercent++;
}
}
}
else if (batchIdx % 10000 == 0)
{
Logger.WriteLine($"Processing batch '{batchIdx}'");
}

SntPair sntPair = new SntPair(tgtLine, tgtLine);
currentTokenCountsInBatch += sntPair.GetTgtTokenCount();
Expand Down
16 changes: 8 additions & 8 deletions Seq2SeqSharp/Models/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ public void AddWeights(string name, float[] weights)
}

(double min, double max, double distortion) = vq.BuildCodebook(vqSize);
if (Math.Abs(max - min) <= 2.0)
{
// if (Math.Abs(max - min) <= 2.0)
// {
Name2CodeBook.Add(name, vq.CodeBook);

byte[] bweights = new byte[weights.Length / 2];
Expand All @@ -225,12 +225,12 @@ public void AddWeights(string name, float[] weights)
}

Name2WeightsVQ.Add(name, bweights);
}
else
{
Logger.WriteLine($"Distortion({distortion}) is too large, so we keep the original values.");
Name2Weights.Add(name, weights);
}
// }
// else
// {
// Logger.WriteLine($"Distortion({distortion}) is too large, so we keep the original values.");
// Name2Weights.Add(name, weights);
// }
}
else
{
Expand Down

0 comments on commit a61fd87

Please sign in to comment.