I am interested in reading caffe source code. Now I am confused that where and when the REGISTER_SOLVER_CLASS(SGD);here is called and executed when training a model?
anyone can give some advises? thank you very much~~
Asked
Active
Viewed 34 times
1
Shai
- 111,146
- 38
- 238
- 371
JustinGong
- 399
- 1
- 4
- 17
1 Answers
2
As you can see in REGISTER_SOLVER_CLASS macro definition, in solver_factory.hpp, Caffe creates static global objects for the solvers. They are initialized when the library loads. See this question + answers for the full details and Windows / UNIX differences.
rkellerm
- 5,362
- 8
- 58
- 95
-
@AndrewGong : Compiling caffe creates a static library (.a on Linux, .lib on Windows) and a dynamic library (.so on Linux, .dll on Windows). I didn't understand your comment, could you please elaborate? – rkellerm Nov 26 '17 at 12:40
-
nothing, and I have deleted the latest commit. your answer is good, thank you! – JustinGong Nov 26 '17 at 13:53