Here is an example of how to use BFGS with the cost minimizer on a generalized linear model with a linear link function. Its similar to the example in the learning experiment. Basically you just need to create the ParameterDifferentiableCostMinimizer, the BFGS line minimizer, and then pass in the right function.
int dimensionality = ...;
List<InputOutputPair<Vector, Vector>> data = ...;
DifferentiableGeneralizedLinearModel glm = new DifferentiableGeneralizedLinearModel(
dimensionality, 1, new LinearFunction());
ParameterDifferentiableCostMinimizer bfgs =
new ParameterDifferentiableCostMinimizer(
new FunctionMinimizerBFGS());
bfgs.setObjectToOptimize(glm);
bfgs.setCostFunction(new MeanSquaredErrorCostFunction());
GradientDescendable learned = bfgs.learn(data);

This reply was modified 4 years, 1 month ago by Baz.