This repository was archived by the owner on Aug 5, 2022. It is now read-only.
-
Couldn't load subscription status.
- Fork 486
The Datum Object
Domenic Curro edited this page Apr 13, 2016
·
2 revisions
Datum is a Google Protobuf Message class used to store data and optionally a label. A Datum can be though of a as a matrix with three dimensions: width, height, and channel.
In this example, we will create a simple Datum, set three input values, and set the label.
Datum datum;
datum.set_width(3); // our data has three inputs
datum.set_height(1); // our data is one-dimensional
datum.set_channels(1);
google::protobuf::RepeatedField<float>* datumFloatData = datum.mutable_float_data();
datumFloatData.Add(0.0f);
datumFloatData.Add(1.0f);
datumFloatData.Add(0.0f);
datum.set_label(2);Datum is often used in a data layer as an intermediate object which helps facilitate setting the batch's data and label (which correspond to the top blobs).