Class Record


  • 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 NDLists), we have the Batch and the Record classes respectively.

    • Constructor Summary

      Constructors 
      Constructor Description
      Record​(NDList data, NDList labels)
      Creates a new instance of Record with a single element of data and its corresponding labels.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      NDList getData()
      Gets the data of this Record.
      NDList getLabels()
      Gets the labels that correspond to the data of this Record.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Record

        public Record​(NDList data,
                      NDList labels)
        Creates a new instance of Record with a single element of data and its corresponding labels.
        Parameters:
        data - an NDList that contains a single element of data
        labels - an NDList that contains the corresponding label
    • Method Detail

      • getData

        public NDList getData()
        Gets the data of this Record.
        Returns:
        an NDList that contains the data of this Record
      • getLabels

        public NDList getLabels()
        Gets the labels that correspond to the data of this Record.
        Returns:
        an NDList that contains label that correspond to the data of this Record