public class Record
extends java.lang.Object
Record
represents a single element of data and labels from Dataset
.
The data and labels in record are in the form of an NDList
. This allows it to hold
multiple types of data and labels. However, note that the NDList
does not include a
dimension for batch.
In a Record
, data and label are each an NDList
. The data NDList
represents the data for each input in the batch. Similarly, the label NDList
represents
the labels for each output.
For example, an Image Question and Answer dataset has two inputs: an image and a question. In
this case, the data in the Record
will be an NDList
containing a CHW image NDArray
and a TC question NDArray
. The label will be an
NDList
containing only a TC answer NDArray
.
In order to differentiate a batch vs a single record (despite them both consisting of two
NDList
s), we have the Batch
and the Record
classes respectively.
Constructor and Description |
---|
Record(NDList data,
NDList labels)
Creates a new instance of
Record with a single element of data and its corresponding
labels. |
Modifier and Type | Method and Description |
---|---|
NDList |
getData()
Gets the data of this
Record . |
NDList |
getLabels()
Gets the labels that correspond to the data of this
Record . |