MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / get_dset

Method get_dset

datasets/ssl_dataset.py:259–278  ·  view source on GitHub ↗

get_dset returns class BasicDataset, containing the returns of get_data. Args is_ulb: If True, returned dataset generates a pair of weak and strong augmented images. strong_transform: list of strong_transform (augmentation) if use_strong_transform is

(self, is_ulb=False,
                 strong_transform=None, onehot=False)

Source from the content-addressed store, hash-verified

257 return data, targets, ulb_data
258
259 def get_dset(self, is_ulb=False,
260 strong_transform=None, onehot=False):
261 """
262 get_dset returns class BasicDataset, containing the returns of get_data.
263
264 Args
265 is_ulb: If True, returned dataset generates a pair of weak and strong augmented images.
266 strong_transform: list of strong_transform (augmentation) if use_strong_transform is True。
267 onehot: If True, the label is not integer, but one-hot vector.
268 """
269
270 if self.name.upper() == 'STL10':
271 data, targets, _ = self.get_data()
272 else:
273 data, targets = self.get_data()
274 num_classes = self.num_classes
275 transform = self.transform
276
277 return BasicDataset(self.alg, data, targets, num_classes, transform,
278 is_ulb, strong_transform, onehot)
279
280 def get_ssl_dset(self, num_labels, index=None, include_lb_to_ulb=True,
281 strong_transform=None, onehot=False):

Callers 14

main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95
main_workerFunction · 0.95

Calls 2

get_dataMethod · 0.95
BasicDatasetClass · 0.85

Tested by

no test coverage detected