You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to do a forward for an image for a pretrained network in C++ (as a first step for some research on checking the conservation of certain physically motivated quantities within a neural net).
I have checked the matlab and python wrappers.
I understand that the input is a float array with width-major addressing in the type of
arr[channel_index * imageheight * imagewidth + height_index * imagewidth + width_index ](correct me if I am wrong)
My questions are:
what image value scaling is required for the input array for the model models/caffe_reference_imagenet_model ?
[0,1] or [0 255] (data_layer.cpp contains an uint8 conversion ... thats a hint for 255) or ??
does the data set mean get substracted internally during a forward for testing phase
or do I have to substract it myself for testing phase (I dont care about training phase here)?
I see the mean gets substracted in the data_layer class,
models/imagenet.prototxt does initialize a data_layer ?
Even if it is initialized it looks like the mean from the data layer will not be used in the matlab wrapper for substraction, right or wrong?
Best, Alex
The text was updated successfully, but these errors were encountered:
The data is converted into uint8 and then scaled with the predefined scaling ratio. The ratio is 0.00390625 (1/255) in some example prototxts to scale [0 255] to [0 1].
The mean is automatically subtracted using mean blob if the meanfile field of data layer is defined in proto. You can also do it by yourself and do not define the meanfile field.
All your questions are actually answered by the source codes. For example, the answer to the third one is in the data_layer.cpp which you head read.
// check if we want to have mean
if (this->layer_param_.has_meanfile()) {
For further details of MATLAB wrapper usage, refer to the matcaffe demo.
With our active development the code is currently its own best documentation, although we are working to have wrapper documentation soon once some recent improvements are in #199#132. Help with this is appreciated!
Hi,
I want to do a forward for an image for a pretrained network in C++ (as a first step for some research on checking the conservation of certain physically motivated quantities within a neural net).
I have checked the matlab and python wrappers.
I understand that the input is a float array with width-major addressing in the type of
arr[channel_index * imageheight * imagewidth + height_index * imagewidth + width_index ](correct me if I am wrong)
My questions are:
what image value scaling is required for the input array for the model models/caffe_reference_imagenet_model ?
[0,1] or [0 255] (data_layer.cpp contains an uint8 conversion ... thats a hint for 255) or ??
does the data set mean get substracted internally during a forward for testing phase
or do I have to substract it myself for testing phase (I dont care about training phase here)?
I see the mean gets substracted in the data_layer class,
models/imagenet.prototxt does initialize a data_layer ?
Even if it is initialized it looks like the mean from the data layer will not be used in the matlab wrapper for substraction, right or wrong?
Best, Alex
The text was updated successfully, but these errors were encountered: