예제 #1
0
 def get_validation_data(self):
     if self.validation_dataset is not None:
         fs = self.validation_dataset.transform(
             MergeFeatureLabelFeatureTransformer())
         fs = fs.transform(SampleToMiniBatch(self.batch_size))
         return fs
     return None
예제 #2
0
 def get_training_data(self):
     sample_rdd = self.rdd.map(
         lambda t: Sample.from_ndarray(nest.flatten(t), np.array([0.0])))
     fs = FeatureSet.sample_rdd(sample_rdd,
                                sequential_order=self.sequential_order,
                                shuffle=self.shuffle)
     fs = fs.transform(SampleToMiniBatch(self.batch_size))
     return fs
예제 #3
0
    def get_training_data(self):
        fs = FeatureSet.image_set(self.image_set,
                                  sequential_order=self.sequential_order,
                                  shuffle=self.shuffle)
        fs = fs.transform(MergeFeatureLabelImagePreprocessing())
        fs = fs.transform(ImageFeatureToSample())
        fs = fs.transform(SampleToMiniBatch(self.batch_size))

        return fs
예제 #4
0
 def get_validation_data(self):
     if self.validation_image_set is not None:
         fs = FeatureSet.image_set(self.validation_image_set,
                                   sequential_order=self.sequential_order,
                                   shuffle=self.shuffle)
         fs = fs.transform(MergeFeatureLabelImagePreprocessing())
         fs = fs.transform(ImageFeatureToSample())
         fs = fs.transform(SampleToMiniBatch(self.batch_size))
         return fs
     return None
예제 #5
0
 def get_training_data(self):
     sample_rdd = self.text_set.get_samples().map(
         lambda sample: Sample.from_jtensor(
             features=sample.features + sample.labels,
             labels=JTensor.from_ndarray(np.array([0.0]))))
     fs = FeatureSet.sample_rdd(sample_rdd,
                                sequential_order=self.sequential_order,
                                shuffle=self.shuffle)
     fs = fs.transform(SampleToMiniBatch(self.batch_size))
     return fs
예제 #6
0
 def get_training_data(self):
     fs = self.dataset.transform(MergeFeatureLabelFeatureTransformer())
     fs = fs.transform(SampleToMiniBatch(self.batch_size))
     return fs