// int numberOfTopics, int numberOfTerms, boolean approximateBeta) throws IOException {
public static HMapIV<double[]> importBeta(SequenceFile.Reader sequenceFileReader,
int numberOfTopics, int numberOfTerms) throws IOException {
HMapIV<double[]> beta = new HMapIV<double[]>();
PairOfIntFloat pairOfIntFloat = new PairOfIntFloat();
HMapIDW hashMap = new HMapIDW();
// HashMap hashMap = new HashMap();
// ProbDist hashMap = null;
// if (!approximateBeta) {
// hashMap = new HashMap();
// } else {
// hashMap = new BloomMap();
// }
while (sequenceFileReader.next(pairOfIntFloat, hashMap)) {
Preconditions.checkArgument(
pairOfIntFloat.getLeftElement() > 0 && pairOfIntFloat.getLeftElement() <= numberOfTopics,
"Invalid beta vector for term " + pairOfIntFloat.getLeftElement() + "...");
// topic is from 1 to K
int topicIndex = pairOfIntFloat.getLeftElement() - 1;
double logNormalizer = pairOfIntFloat.getRightElement();
// double logNormalizer = Math.log(pairOfIntFloat.getRightElement());
// double logNormalizer = Math.log(hashMap.getNormalizeFactor());
// logNormalizer = LogMath.add(pairOfIntFloat.getRightElement(),
// Settings.DEFAULT_LOG_ETA + Math.log(numberOfTerms));