How do I use digital tags for regression in Caffe?

advertisements

I search the Caffe source code a bit, and the ReadImageToDatum function in caffe/src/caffe/util/io.cpp only supports int type labels.

I've also noticed that there's an array_to_datum function in caffe/python/caffe/io.py, which seems to not have the constraint on the type of label, but I'm not exactly sure how I'm supposed to use it.

How can I use numerical (non-integers) labels for regression?


I suppose Datum type was designed with image classification in mind.
For regression, I recommend using "HDF5Data" input layer.
See this answer for example.

Using hdf5 binary files allows for more flexibility in the number, shape and type of inputs you feed your net.