BP_LDA.LDA_Learn.ComputeCrossEntropy C# (CSharp) Method

ComputeCrossEntropy() public static method

public static ComputeCrossEntropy ( SparseMatrix Xt, DenseMatrix Phi, DenseMatrix theta_top ) : float
Xt LinearAlgebra.SparseMatrix
Phi LinearAlgebra.DenseMatrix
theta_top LinearAlgebra.DenseMatrix
return float
		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)

Same methods

LDA_Learn::ComputeCrossEntropy ( SparseMatrix Xt, DenseMatrix Phi, DenseMatrix theta_pool, int nHidLayerEffective ) : float