zimio
zimio

Reputation: 107

What is a "label" in Caffe?

In Caffe when you are defining your inputs for the NN in the protobuf file, you can input "data" and "label". I'm guessing label contains the expected output for training data (what it is normally considered the y values in Machine Learning literature).

My problem is that in the caffe.proto file, label is defined as a scalar (int or long). At least with data, I can set it to an numpy array, because it takes String values. If I'm training for more than one prediction output, how could I pass it as an array?

Or am I mistaken? What is label? What is it for? And how can I pass the y values to caffe?

Upvotes: 1

Views: 1531

Answers (1)

Shai
Shai

Reputation: 114786

The basic use case of caffe used to be image classification: assigning a single integer label per input image. Thus, the "datum" data structure reserves space for a 4D float array (batches of 3 channels images) and an integer "label" per image in the batch.

This restriction can be easily overcome using HDF5 input data layer.
See e.g., this answer.

Upvotes: 3

Related Questions