コード例 #1
0
ファイル: dataset.py プロジェクト: chema969/spp
    def generate_test(self,
                      batch_size,
                      encode,
                      soft_ordinal_conf,
                      ensemble=False,
                      ensemble_type='regression'):
        # Load dataset if not loaded
        self.load(self._name)

        if self._big_dataset:
            return BigGenerator(self._df_test,
                                self._base_path,
                                self._num_classes,
                                self._x_col,
                                self._y_col,
                                mean=self.mean_train,
                                std=self.std_train,
                                encode=encode,
                                batch_size=batch_size,
                                labels=self._labels,
                                soft_ordinal_config=soft_ordinal_conf,
                                ensemble=ensemble,
                                ensemble_type=ensemble_type)
        else:
            return SmallGenerator(self._x_test,
                                  self._y_test,
                                  self._num_classes,
                                  mean=self.mean_train,
                                  std=self.std_train,
                                  batch_size=batch_size,
                                  encode=encode,
                                  labels=self._labels,
                                  soft_ordinal_config=soft_ordinal_conf,
                                  ensemble=ensemble,
                                  ensemble_type=ensemble_type)
コード例 #2
0
	def generate_test(self, batch_size):
		# Load dataset if not loaded
		self.load(self._name)

		if self._big_dataset:
			return BigGenerator(self._df_test, self._base_path, self._num_classes, self._x_col, self._y_col, mean=self.mean_train, std=self.std_train, batch_size=batch_size)
		else:
			return SmallGenerator(self._x_test, self._y_test, self._num_classes, mean=self.mean_train, std=self.std_train, batch_size=batch_size)
コード例 #3
0
	def generate_test(self, batch_size, labels_transform=lambda labels, n: to_categorical(labels, num_classes=n)):
		# Load dataset if not loaded
		self.load(self._name)

		if self._big_dataset:
			return BigGenerator(self._df_test, self._base_path, self._num_classes, self._x_col, self._y_col, mean=self.mean_train, std=self.std_train, batch_size=batch_size, labels_transform=labels_transform)
		else:
			return SmallGenerator(self._x_test, self._y_test, self._num_classes, mean=self.mean_train, std=self.std_train, batch_size=batch_size, labels_transform=labels_transform)
コード例 #4
0
    def generate_train(self, batch_size, augmentation):
        # Load dataset if not loaded
        self.load(self._name)

        if self._big_dataset:
            return BigGenerator(self._df_train,
                                self._base_path,
                                self._num_classes,
                                self._x_col,
                                self._y_col,
                                mean=self.mean_train,
                                std=self.std_train,
                                batch_size=batch_size,
                                augmentation=augmentation,
                                workers=self._workers)
        else:
            return SmallGenerator(self._x_train,
                                  self._y_train,
                                  self._num_classes,
                                  mean=self.mean_train,
                                  std=self.std_train,
                                  batch_size=batch_size,
                                  augmentation=augmentation,
                                  workers=self._workers)