class OnlineLogLikelihood extends ComputeFunction {

	@Override
	public void calc(ComContext context) {

		double[] logLikeliHooks = new double[]{0};
		context.putObj(LdaVariable.logLikelihood, logLikeliHooks);
		if (context.getStepNo() == numIter) {
			Tuple2<Long, Integer> tuple2 = ((List<Tuple2<Long, Integer>>) context.getObj(LdaVariable.shape)).get(0);
			int vocabularySize = tuple2.f1;

			DenseMatrix lambda = context.getObj(LdaVariable.lambda);
			DenseMatrix alpha = context.getObj(LdaVariable.alpha);

			//get data
			List<Vector> data = context.getObj(LdaVariable.data);

			int taskNum = context.getNumTask();

			DenseMatrix gammad = null;

			double logLikelihood = logLikelihood(data, lambda, alpha, gammad,
				numTopic, vocabularySize, beta, taskNum);

			logLikeliHooks[0] = logLikelihood;
			context.putObj(LdaVariable.logLikelihood, logLikeliHooks);
		}
	}

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

}