}
@Override
public Matrix getValueGradient() {
LogisticRegressionGradient grad = logReg.getGradient( lr );
Matrix ret = new DenseMatrix( 1, getNumParameters() );
for (int i = 0; i < MatrixUtils.length( ret ); i++) {
if ( i < MatrixUtils.length( logReg.connectionWeights ) ) {
MatrixUtils.setElement( ret, i, MatrixUtils.getElement( grad.getwGradient(), i ) );
} else {
MatrixUtils.setElement( ret, i, MatrixUtils.getElement( grad.getbGradient(), i - MatrixUtils.length( logReg.connectionWeights ) ) );
}
}
return ret;