DIGITS icon indicating copy to clipboard operation
DIGITS copied to clipboard

Doubts on how Caffe transform_param are applied in Digits

Open enoonIT opened this issue 10 years ago • 6 comments

[Latest version of Digits in use] I'm using a default Alexnet where i changed the transform params for the data (train and test) layers, by adding:

transform_param {
    ...
   mean_value: 128
   scale:  0.5
}

Two questions:

  1. the scale parameter seems to be ignored, at least during Classify One Image, where the image histogram in data activation is not changed by the scale factor. Is this normal?

  2. If I click on "Subtract Mean" during the model creation, there seems no way to make the network use the mean values I manually defined in the network definition. My values are preserved only if I never click on the dropdown. If I click, there seems to be no way to tell digits to just use the network defined values. Am I missing something? Maybe an option like 'Use network defaults' would be nice.

enoonIT avatar Apr 09 '16 14:04 enoonIT

Furthermore, even when the user defined mean value is accepted by the network (and correctly reported in train_val.prototxt) it is still ignored by the classify one image method.

enoonIT avatar Apr 09 '16 14:04 enoonIT

Indeed data layers are ignored by Caffe during inference. If you wish to perform transformations on your input data you can use a Power layer, see this example.

gheinrich avatar Apr 10 '16 08:04 gheinrich

Hi, thanks for the answer. I think this behavior is a bit confusing, as the mean values selected by drop-down at model creation is, on the contrary, applied to the inference. So, If the mean is defined in the prototxt then it is ignored by the inference. But if the mean is defined by the Digits gui, then it is used during inference. Correct?

enoonIT avatar Apr 10 '16 12:04 enoonIT

So, If the mean is defined in the prototxt then it is ignored by the inference.

I don't think it's entirely correct. Data layers are used to load data from LMDB or LevelDB databases and they are not used during inference (when input fields are being used instead). If you were to perform your transformations in a Power layer then they would apply to all stages.

gheinrich avatar Apr 10 '16 14:04 gheinrich

Ok, thanks for the clarification. Still, If I select a specific Subtract Mean in the Data Transformations panel of the Digits GUI this will apply both to the Data layer AND to the inference.

Anyway, the safest bet seems to do all transforms in the power layer.

enoonIT avatar Apr 10 '16 14:04 enoonIT

Thanks. It sounds like this answers your question so I'll close the issue. Feel free to post a question on https://groups.google.com/forum/#!forum/digits-users if you need any more information.

gheinrich avatar Apr 11 '16 19:04 gheinrich