public static float ComputeCrossEntropy(SparseMatrix Xt, DenseMatrix Phi, DenseMatrix theta_top)
{
SparseMatrix TmpSparseMat = new SparseMatrix(Xt);
DenseRowVector TmpDenseRowVec = new DenseRowVector(Xt.nCols);
MatrixOperation.MatrixMultiplyMatrix(TmpSparseMat, Phi, theta_top);
MatrixOperation.Log(TmpSparseMat);
MatrixOperation.ElementwiseMatrixMultiplyMatrix(TmpSparseMat, Xt);
MatrixOperation.VerticalSumMatrix(TmpDenseRowVec, TmpSparseMat);
return (-1.0f) * TmpDenseRowVec.VectorValue.Sum();
}
public static float ComputeCrossEntropy(SparseMatrix Xt, DenseMatrix Phi, DenseMatrix[] theta_pool, int[] nHidLayerEffective)