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

Specify net params in solver; log {Net,Solver} parameters; multiple test nets #404

Merged
merged 9 commits into from
May 20, 2014

Conversation

jeffdonahue
Copy link
Contributor

This PR introduces three changes:

  1. (65ef9ff) Allows you to specify, inside a SolverParameter, a train_net_param (instead of a train_net filename) and a test_net_param (instead of a test_net filename), directly specifying the full net parameters inside the solver prototxt. Crashes if both train_net_param and train_net are specified. Rationale: IMO, especially for small nets, it's easier than viewing/editing 2-3 separate files. (I like to use find/replace all and not have to do it in both the train/test net separately.) Also would be useful in any future Solver unit tests (rather than having to create inside the unit test a temp train net and temp test net file).

  2. (bf66ac2) Logs the Net/Solver parameters upon init to INFO. Rationale: I have probably thousands of Caffe logs from training runs where I was "manually cross-validating" a parameter or two inside of a net or solver and quickly starting/stopping training without actually saving a copy of the net/solver prototxts. If those logs had the Solver/Net parameters in them, it would be substantially easier to tell what meaning (if any) they had. The drawbacks would be the increased size of the logs and increased amount of (in this case mostly redundant) information printed during training, but at least in my use of Caffe, the benefit strongly outweighs the drawback here...

  3. (c97fff6) Allows you to specify multiple test nets (either as test_net_params or test_nets, processing them in order starting with all test_net_params). Rationale: measure accuracy on additional datasets (e.g., the training set), with multiple loss functions, ...

In b64c597 I added a file lenet_consolidated_solver.prototxt which demos changes (1) and (3).

@tdomhan
Copy link
Contributor

tdomhan commented May 10, 2014

great PR! the only thing is that when you want to test on different sets (like a test and a validation set) the sets probably have different sizes, but right now there is only a single test_iter.

@jeffdonahue
Copy link
Contributor Author

Yup, thanks @tdomhan, good point.

@shelhamer
Copy link
Member

Nice. The lenet example and requiring one or the other netparam options are helpful for this to be used right. Plus this is a good stop-gap until I finally do #57 haha.

Thanks @jeffdonahue and @tdomhan!

shelhamer added a commit that referenced this pull request May 20, 2014
Specify net params in solver; log {Net,Solver} parameters; multiple test nets
@shelhamer shelhamer merged commit c30bb24 into BVLC:dev May 20, 2014
@jeffdonahue jeffdonahue deleted the net-param-in-solver branch July 30, 2014 01:38
@shelhamer shelhamer mentioned this pull request Aug 8, 2014
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
Specify net params in solver; log {Net,Solver} parameters; multiple test nets
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.

3 participants