Implemeted gradient descent optimizer. #792

merged 4 commits into from Oct 7, 2016


None yet

2 participants


No description provided.

@sumedhghaisas sumedhghaisas Implemeted gradient descent optimizer.
+ double lastObjective = DBL_MAX;
+ // Now iterate!
+ arma::vec gradient(iterate.n_cols);
rcurtin Sep 29, 2016 Member

This should be arma::mat not arma::vec, and you should use both the number of rows and columns to initialize it. Otherwise it will fail if we use an objective function that uses a 2-d matrix instead of a 1-d vector.

+ {
+ Log::Warn << "Gradient Descent: converged to " << overallObjective
+ << "; terminating" << " with failure. Try a smaller step size?"
+ << std::endl;
rcurtin Sep 29, 2016 Member

Continued lines should be intended two tabs from the previous line, not one :)

@sumedhghaisas sumedhghaisas Minor bug fixes in Gradient Descent module
rcurtin commented Sep 30, 2016

Once you fix the constructor to arma::mat so it compiles I think this is ready to merge. :)

@sumedhghaisas sumedhghaisas Minor fix in gradien descent
rcurtin commented Oct 2, 2016

Ah I forgot, we should also add something to to point out that we now have a gradient descent optimizer. :)

@sumedhghaisas sumedhghaisas Added Gradient Descent in HISTORY file
@rcurtin rcurtin merged commit 5fd5395 into mlpack:master Oct 7, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment