pseudo_labeled_dataset
PseudoLabeledDataset
¶
Bases: DomainDataset
The wrapped dataset's __getitem__
function
should return a tuple of (data, label)
.
The label will then be discarded,
and the pseudo label will be returned instead.
Source code in pytorch_adapt\datasets\pseudo_labeled_dataset.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
__getitem__(idx)
¶
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
A dictionary with keys
|
Source code in pytorch_adapt\datasets\pseudo_labeled_dataset.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
__init__(dataset, pseudo_labels, domain=0)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset |
Dataset
|
The dataset to wrap |
required |
pseudo_labels |
List[int]
|
The class labels that will be used instead of the labels contained in self.dataset |
required |
domain |
int
|
An integer representing the domain. |
0
|
Source code in pytorch_adapt\datasets\pseudo_labeled_dataset.py
16 17 18 19 20 21 22 23 24 25 26 27 28 |
|