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

Expose SGDSolver to pycaffe #286

Merged
merged 7 commits into from
Apr 9, 2014
Merged

Expose SGDSolver to pycaffe #286

merged 7 commits into from
Apr 9, 2014

Conversation

longjon
Copy link
Contributor

@longjon longjon commented Apr 2, 2014

This allows training nets directly from Python (without using subprocess or syncing net parameters with the filesystem). The resulting nets can be immediately examined and used for prediction through the existing Python interface. (This is useful for quick interactive experiments, and scripts that need to train nets in a loop or perform intermediate processing during training.)

This makes it possible to manage the Net pointer externally (e.g., from
the Python interface) using a shared_ptr. No existing code is affected.
Also, internally drop the "Caffe" prefix for classes exported by the
internal _caffe module. This change means that SGDSolver will
automatically return a Net with the "nice" Python interface rather than
the internal one, (and avoids the extra layer of method wrapping that
results from switching to composition).
@longjon
Copy link
Contributor Author

longjon commented Apr 5, 2014

Now rewriting Net methods instead of using inheritance. (It seems our previous conversation is no longer visible here since it was commit-linked.) I'm satisfied with this choice; it's the simplest for now, it can be changed later, and it lets #294 go through without anything additional.

shelhamer added a commit that referenced this pull request Apr 9, 2014
Expose SGDSolver to pycaffe, switch from inheritance to overriding for caffe.Net
@shelhamer shelhamer merged commit 0c623fc into BVLC:dev Apr 9, 2014
@shelhamer
Copy link
Member

Thanks Jon!

@shelhamer shelhamer mentioned this pull request May 20, 2014
@alexbw
Copy link

alexbw commented Sep 16, 2014

Would be great if there was an IPython notebook example of this, or any reference materials to get someone started who's less familiar with caffe internals. Seems like an awesome feature!

mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
Expose SGDSolver to pycaffe, switch from inheritance to overriding for caffe.Net
@longjon longjon deleted the pycaffe-solver branch December 30, 2014 05:00
@vzhong
Copy link

vzhong commented Feb 22, 2015

I second @alexbw's comment. @longjon @shelhamer would it be possible for you to post a brief example on how to use the python interface to train a net?

@evolu8
Copy link

evolu8 commented Apr 19, 2015

I third (4th?) this. @longjon @shelhamer or anyone, please can we get a python example for training

@shelhamer
Copy link
Member

Here's solving LeNet in Python from the tutorial branch. The new notebooks and presentation content will be merged soon.

@evolu8
Copy link

evolu8 commented Apr 20, 2015

Wonderful! Thank you!!

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

Successfully merging this pull request may close these issues.

5 participants