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

Method __init__

datasets/ssl_dataset.py:198–220  ·  view source on GitHub ↗

Args alg: SSL algorithms name: name of dataset in torchvision.datasets (cifar10, cifar100, svhn, stl10) train: True means the dataset is training dataset (default=True) num_classes: number of label classes data_dir: path of directo

(self,
                 args,
                 alg='fixmatch',
                 name='cifar10',
                 train=True,
                 num_classes=10,
                 data_dir='./data')

Source from the content-addressed store, hash-verified

196 """
197
198 def __init__(self,
199 args,
200 alg='fixmatch',
201 name='cifar10',
202 train=True,
203 num_classes=10,
204 data_dir='./data'):
205 """
206 Args
207 alg: SSL algorithms
208 name: name of dataset in torchvision.datasets (cifar10, cifar100, svhn, stl10)
209 train: True means the dataset is training dataset (default=True)
210 num_classes: number of label classes
211 data_dir: path of directory, where data is downloaed or stored.
212 """
213 self.args = args
214 self.alg = alg
215 self.name = name
216 self.train = train
217 self.num_classes = num_classes
218 self.data_dir = data_dir
219 crop_size = 96 if self.name.upper() == 'STL10' else 224 if self.name.upper() == 'IMAGENET' else 32
220 self.transform = get_transform(mean[name], std[name], crop_size, train)
221
222 def get_data(self, svhn_extra=True):
223 """

Callers 1

__init__Method · 0.45

Calls 1

get_transformFunction · 0.85

Tested by

no test coverage detected