-
Notifications
You must be signed in to change notification settings - Fork 227
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
Modifications and Extension of Preconditioning #191
Conversation
…ent with dispatch functionality; implemented a rudimentary constant matrix preconditioner; all tests passing. TODO: preconditioned L-BFGS and benchmarks
@timholy do you have time for a short glimpse at this? |
@@ -51,15 +56,15 @@ function optimize{T}(d::DifferentiableFunction, | |||
|
|||
# The current search direction | |||
s = similar(x) | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these tabs were added by mistake? (three additional instances below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now reverted.
Thank you for the PR, and sorry for the delay. I've left some line notes, and pinged the original author of the code (as far as I can see). |
Enough has changed that I don't have time to dig in now and offer a good review, but in general terms I'm totally in favor of taking any code I wrote and making it better. |
From @timholy 's perspective the only change is the move of the preconditioner code to |
I made the changes and pushed them - do I need to do anything to update the pull request? |
No, if you push it to the same exact branch, it should update. Are you sure you committed before pushing? |
Yes, I am sure: I haven't done this before, but am following Julia documentation. Sorry, if I've messed something up. I can always create a new pull request. |
Ah, okay. The first time you pushed to your fork, you pushed to |
|
I'm really sorry for making a mess. Here is the Julia documentation, is this incorrect and should it be fixed? The package owner may suggest additional improvements. To respond to those suggestions, you can easily update the pull request (this only works for changes that have not already been merged; for merged pull requests, make new changes by starting a new branch): If you’ve changed branches in the meantime, make sure you go back to the same branch with git checkout fixbar (from shell mode) or Pkg.checkout("Foo", "fixbar") (from the Julia prompt). |
Current coverage is 85.26%@@ master #191 diff @@
==========================================
Files 30 31 +1
Lines 1866 1872 +6
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1592 1596 +4
- Misses 274 276 +2
Partials 0 0
|
Ok, this did it: |
Yes, sorry, that was my bad! I thought the branch was also called |
end | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you missed one. Sorry, but this just makes it easier when going through old versions looking through changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very happy to do it, since this is your code. But for what it's worth, I find it harder to read that way since the indentation guides don't show up correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean. I'm talking about line 97 which is an empty line. Is it something in your editor you are referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to see it worked out :) One minor comment has been made. I'm kind of wondering why |
thank you for the help. |
Are you familiar with the process of squashing in git? It basically means to rewrite history such that it appears as if several commits were made at once. I am asking because I would prefer if you could do this to your 6 commits. Again, this is beneficial if we need to go back in time through the git history, to find a bug introduced somewhere. Sometimes it would be okay to have more than one commit, for example: I would propose that you simply squash everything into one commit, that I can then merge into The process is quite easy. I do recommend making a back-up branch in case you mess something up (I did the first few times...)
This should show you an editor with all your commits. They will all have "pick" written at the beginning of their respective lines. Change the five last (bottom) to
Notice the last command is quite dangerous, as you force push ( |
FWIW you can squash from the github ui now. When you press merge you get to chose to merge it with a merge commit or to squash everything. |
Oh, so I can do it? Then don't bother @cortner , unless you want to try it out. |
Yes you can do it. |
Squashed commits: [5a64f9a] added test/precon.jl [4066ed9] implemented precond for L-BFGS; reverted the precondprep implementation to passing it as argument (nor now); replaced precondprep with precondprep! and precondprepbox with precondprepbox! and precondfwd with precondfwd!; fixed constrained.jl; tests all pass [f7c92d0] further comments [e8a4cf1] added preconditioning to GradientDescent; implemented tests; all tests pass
this ok? |
Yes, Ill finish this when I'm at a computer. Thank you for the pr. |
Done. Thanks for the PR. Hope you enjoyed the Github ride! Let us keep the preconditioning discussion open in #188 . |
Nice contribution. Thanks. |
This was discussed in Issue 188.
precon.jl
GradientDescent
and toLBFGS
test/precon.jl
to test preconditioning capabilitiesDocumentation has been added in a separate pull request #190 .
I think this is just a quick and dirty implementation. I suggest more
substantial changes in this direction in Issue 188.