Deduplicate solver regularization, logging, and local rates and decays #2518

Merged
merged 3 commits into from May 27, 2015

Conversation

Projects
None yet
3 participants
Owner

shelhamer commented May 27, 2015

This simplifies the solver code by de-duplicating shared logic.

  • ca81667 is taken from #2397 by @cypof but renames Solver::Iteration() to Solver::MakeUpdate()
    to verb.
  • a85f7f1 is a minor follow-up to simplify #1977

I plan to merge this shortly to make way for an updated #1977.

Contributor

jeffdonahue commented May 27, 2015

I just looked over this -- looks great! This refactoring was much needed. Thanks @cypof and @shelhamer. Only issue I see is I'm not sure about the verb in MakeUpdate -- I think DoUpdate or PerformUpdate would be more suggestive of what it does. Personally when I first saw the name MakeUpdate in the PR text, I guessed its purpose was that of ComputeUpdateValue.

Contributor

jeffdonahue commented May 27, 2015

Actually, I guess it is replacing ComputeUpdateValue, but also doing net_->Update() at the end. Would it not be better to keep calling it ComputeUpdateValue and just keep net_->Update at the end of the body of Step?

Contributor

cypof commented May 27, 2015

No the net_->Update() needs to be in, so that it is not executed by solvers that are not of type SGDSolver. This way, only the root solver in a parallel setup will apply the update. That was actually the race I introduced when I split the big PR into small ones. Another name could be ApplyGradients?

Contributor

jeffdonahue commented May 27, 2015

Okay, I see -- thanks for the explanation @cypof. I like Apply but also like Update; how about ApplyUpdate?

@shelhamer shelhamer Solver::MakeUpdate() -> Solver::ApplyUpdate
Designate `Solver::ApplyUpdate()` as the core method to compute
and apply parameter updates given the current state of the Net.

Make `Solver::ComputeUpdateValue()` a subordinate call overloaded by the
`SGDSolver`s to take care of optimization algorithm details.
76db47e
Owner

shelhamer commented May 27, 2015

Thanks for the comments @cypof and @jeffdonahue. I went with ApplyUpdate. Please merge if this looks right to you, Jeff.

Owner

shelhamer commented May 27, 2015

p.s. ignore the travis push check -- the travis Pr check is the one to heed. The push check was triggered by my accidental push to BVLC/caffe and then my deleting the branch made it fail.

Contributor

jeffdonahue commented May 27, 2015

Cool, LGTM

@jeffdonahue jeffdonahue added a commit that referenced this pull request May 27, 2015

@jeffdonahue jeffdonahue Merge pull request #2518 from shelhamer/dedup_solvers
Deduplicate solver regularization, logging, and local rates and decays
b12c171

@jeffdonahue jeffdonahue merged commit b12c171 into BVLC:master May 27, 2015

1 of 2 checks passed

continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

shelhamer deleted the shelhamer:dedup_solvers branch May 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment