DoubleVector foldMatrices = DenseMatrixFolder.foldMatrices(pInput
.getWeights());
RBMCostFunction fnc = new RBMCostFunction(test, 0, 1, hiddenUnits,
new SigmoidActivationFunction(), TrainingType.CPU, 0.1d,
MultilayerPerceptron.SEED, false);
CostGradientTuple evaluateCost = fnc.evaluateCost(foldMatrices);
assertEquals(10.62, evaluateCost.getCost(), 1e-2);
DoubleVector target = new DenseDoubleVector(new double[] { 0.0,
0.02692309216175836, 0.028617918716451567, -0.38090575317687425,
-0.2733580157966874, -0.05362476178552118, 0.028442797042677864,
-0.0074216500178369334, -0.020646406447972637, 0.23725599589259425,
0.1600803118285869, 0.021548762957205637, 0.21119663986488538,
0.13831721457512378, 0.018655747667396447, 0.027585532151946184,
0.07822896273093058, 0.06138838685387988, 0.018894892958963183,
0.05127725047277514, 0.04652138168121131, -0.08117434385333744,
-0.006630919993730764, 0.037822963939552194 });
assertEquals(0d, evaluateCost.getGradient().subtract(target).sum(), 1e-4);
}