Layer by Layer feedforward

280 views
Skip to first unread message

Robert Krutsch

unread,
Feb 22, 2016, 8:26:57 AM2/22/16
to Caffe Users
Hi,

I would like to run the feed forward part layer by layer. So for instance for a network with 3 Conv layers , would run the first layer , modify something in the output blob of conv1 and then feed that as input blob in the next conv layer and so on. Ideally through python.. If not I would use the test infrastructure in C to do that but it is a significant amount of work for a proof of concept.

I want to test how precision changed affect the outcome and would like to avoid at this point to change each and every layer in caffe to make like a proof of the method.

Thanks,
Rob

Jan C Peters

unread,
Feb 22, 2016, 10:23:14 AM2/22/16
to Caffe Users
Shouldn't be a problem in pycaffe. Do just as in the usual code found here for instance to feed a single sample through the network. Only instead of calling net.forward(), which does the complete forward pass, call something like net.forward(start=..., end=...). To see why this is possible and how this works, refer to https://github.com/BVLC/caffe/blob/master/python/caffe/pycaffe.py#L62.

Jan

Robert Krutsch

unread,
Feb 22, 2016, 11:05:48 AM2/22/16
to Caffe Users
What I was confused about was how to pass the input blob. I was a little biased with matconvnet api where one can call layer by layer. Thanks for the answer.
Reply all
Reply to author
Forward
0 new messages