class OnlineLogLikelihood extends ComputeFunction {

	public static double logSumExp(DenseMatrix dm) {
		double max = dm.get(0, 0);
		for (int i = 0; i < dm.numRows(); i++) {
			for (int j = 0; j < dm.numCols(); j++) {
				if (dm.get(i, j) > max) {
					max = dm.get(i, j);
				}
			}
		}
		double sum = 0;
		for (int i = 0; i < dm.numRows(); i++) {
			for (int j = 0; j < dm.numCols(); j++) {
				sum += Math.exp(dm.get(i, j) - max);
			}
		}
		return max + Math.log(sum);
	}

	public  OnlineLogLikelihood(double beta, int numTopic, int numIter);

}