Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function opimization routines + tests #3

Merged
merged 14 commits into from
Mar 8, 2015
Merged

Function opimization routines + tests #3

merged 14 commits into from
Mar 8, 2015

Conversation

mzhurovich
Copy link
Contributor

What has been done:

  • Function optimization routines were moved to fncas_optimize.h
  • These routines are now classes Optimizer<F>, which use F::compute() in their mainOptimize() function
  • In addition to the original naive gradient descent, implemented:
    1. gradient descent with backtracking
    2. simple conjugate gradients method (backtracking + Polak–Ribière)
  • A number of tests, including algorithm comparison

@mzhurovich
Copy link
Contributor Author

@dkorolev Look at this, please :)

template<typename T> void SetValue(std::string name, T value);
template<typename T> const T GetValue(std::string name, T default_value);
private:
std::map<std::string, double> params_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll make these class members later on, no need to parse by name and vice versa.

@dkorolev
Copy link
Contributor

dkorolev commented Mar 6, 2015

Hi @mzhurovich ,

Looks really good! I left a few minor comments. The top-level takeaway message is:

  1. A few more math-related methods can go into mathutils.h, it would make the math optimization code a bit more readable.
  2. I personally vote for much stricter NaN and INF checking. From my experience, those issues will show up soon enough on real-life functions, since exponents are common in ML costs.
  3. More comments on the methods and functions would be great to have. Links to Wikipedia/Wolfram/MathWorld would often be enough.

Thanks!
Dima

@dkorolev dkorolev mentioned this pull request Mar 8, 2015
@mzhurovich
Copy link
Contributor Author

@dkorolev Hey, just added latest changes, PTAL

dkorolev added a commit that referenced this pull request Mar 8, 2015
Function opimization routines + tests
@dkorolev dkorolev merged commit 7a69a48 into KnowSheet:from_dkorolev Mar 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants