Instance inst = m_data.instance(instIdx);
double kl1 = 0.0, kl2 = 0.0, tmp = 0.0;
for (int i = 0; i < inst.numValues(); i++) {
tmp = input.Py_x.get(inst.index(i), instIdx);
if(tmp != 0) {
kl1 += tmp * Math.log(tmp / (tmp * pi1 + pi2 * T.Py_t.get(inst.index(i), t)));
}
}
for (int i = 0; i < m_numAttributes; i++) {
if ((tmp = T.Py_t.get(i, t)) != 0) {
kl2 += tmp * Math.log(tmp / (input.Py_x.get(i, instIdx) * pi1 + pi2 * tmp));