I want to use gradient descent with BFGS for a machine learning problem.
In the API I found the ParameterDifferentiableCostMinimizer that seems to be designed to do the job.
Can you please show me an example of how to use this for say, linear regression?
Congrats to the new release btw. Keep up the good work!
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 =
GradientDescendable learned = bfgs.learn(data);
This reply was modified 3 years, 9 months ago by Baz.