Reputation: 914
I am reading caffe source code now.
I am confused about LayerSetUp
and Reshape
methods.
Some layers have both of these methods, others have one or none...
Why? Can anyone explain this to me?
Upvotes: 1
Views: 821
Reputation: 114786
LayerSetUp
is called once when loading the net. It's aim is to
(a) Verify the layer has exactly the right number of input/output blobs
(b) Read the parameters of the layer from the prototxt
(c) Initialize internal parameters
On the other hand, Reshape
is used to allocate memory for parameters and output blobs and can be called even after the net was setup. For instance, it is common for detection networks to change the input shape, thus Reshape
ing all consequent blobs.
Upvotes: 6