Beispiel #1
0
 def numpy(self):
     if self.num_samples == 1 and self.squeeze_dim:
         return create_numpy_dict(self.dataset, self.offset)
     else:
         return [
             create_numpy_dict(self.dataset, self.offset + i)
             for i in range(self.num_samples)
         ]
Beispiel #2
0
 def numpy(self):
     if isinstance(self.indexes, int):
         return create_numpy_dict(self.dataset, self.indexes)
     else:
         return [
             create_numpy_dict(self.dataset, index)
             for index in self.indexes
         ]
Beispiel #3
0
    def numpy(self, label_name=False):
        """Gets the value from different tensorview objects in the datasetview schema

        Parameters
        ----------
        label_name: bool, optional
            If the TensorView object is of the ClassLabel type, setting this to True would retrieve the label names
            instead of the label encoded integers, otherwise this parameter is ignored.
        """
        if isinstance(self.indexes, int):
            return create_numpy_dict(self.dataset,
                                     self.indexes,
                                     label_name=label_name)
        else:
            return np.array([
                create_numpy_dict(self.dataset, index, label_name=label_name)
                for index in self.indexes
            ])
Beispiel #4
0
    def numpy(self, label_name=False):
        """Gets the values from different tensorview objects in the dataset schema

        Parameters
        ----------
        label_name: bool, optional
            If the TensorView object is of the ClassLabel type, setting this to True would retrieve the label names
            instead of the label encoded integers, otherwise this parameter is ignored.
        """
        return [
            create_numpy_dict(self, i, label_name=label_name)
            for i in range(self._shape[0])
        ]
Beispiel #5
0
 def numpy(self):
     return [create_numpy_dict(self, i) for i in range(self._shape[0])]