domid.tasks package¶
Submodules¶
domid.tasks.b_task_cluster module¶
domid.tasks.task_her2 module¶
- class domid.tasks.task_her2.NodeTaskHER2(succ=None)[source]¶
Bases:
NodeTaskDictCluster
HER2 task where the HER2 categories are considered “domains”
- property list_str_y¶
Labels are not used in clustering. So, we just return a dummy list for now (for compatibility with domainlab).
- property isize¶
image size object storing image channels, height, width.
- Type:
return
- get_dset_by_domain(args, na_domain, split=True)[source]¶
Get a dataset by domain name :param args: command line arguments :param na_domain: domain name :param split: whether a training/validation split is performed (the training split portion will be determined by args.split); for test set, no need to split; args.split: by default, split is set to be zero which in python can be evaluated in if statement, in which case, no separate validation set will be created. Otherwise, this argument is the percentage of the data to be used as training set, while the rest will be used as validation set. :return: training dataset, validation dataset
domid.tasks.task_mnist module¶
- class domid.tasks.task_mnist.NodeTaskMNIST(succ=None)[source]¶
Bases:
NodeTaskMNISTColor10
Basic MNIST task where the digits are considered “domains”
The digits (0, 1, …, 9) are regarded as domains (to be separated by unsupervised clustering). Based on NodeTaskMNISTColor10 from DomainLab.
- property list_str_y¶
MNIST task has no labels (digits are considered domains)
- property isize¶
image size object storing image channels, height, width.
- Type:
return
- get_dset_by_domain(args, na_domain, split=True)[source]¶
Get a dataset by digit
- Parameters:
args – command line arguments
na_domain – domain name
split – whether a training/validation split is performed (the training split portion will be determined by args.split); for test set, no need to split; args.split: by default, split is set to be zero which in python can be evaluated in if statement, in which case, no separate validation set will be created. Otherwise, this argument is the percentage of the data to be used as training set, while the rest will be used as validation set.
- Returns:
training dataset, validation dataset
domid.tasks.task_mnist_color module¶
Color MNIST with palette
- class domid.tasks.task_mnist_color.NodeTaskMNISTColor10(succ=None)[source]¶
Bases:
NodeTaskDictCluster
Use the deafult palette with 10 colors
- property dim_y¶
classification dimension
- property list_str_y¶
getter for list_str_y
- property isize¶
image channel, height, width
- get_list_domains()[source]¶
get list of domain names
better use method than property so new domains can be added
- get_dset_by_domain(args, na_domain, split=True)[source]¶
get_dset_by_domain. :param args: :param na_domain: :param split: for test set, no need to split args.split: by default, split is set to be zero which in python can be evaluated in if statement, in which case, no validation set will be created. Otherwise, this argument is the split ratio
domid.tasks.task_unittest module¶
- class domid.tasks.task_unittest.NodeTaskUnitTest(succ=None)[source]¶
Bases:
NodeTaskDictCluster
Basic USPS task where the digits are considered “domains”
The digits (0, 1, …, 9) are regarded as domains (to be separated by unsupervised clustering). Based on NodeTaskMNISTColor10 from DomainLab.
- property list_str_y¶
MNIST task has no labels (digits are considered domains)
- property isize¶
image size object storing image channels, height, width.
- Type:
return
- get_dset_by_domain(args, na_domain, split=False)[source]¶
Get a dataset by digit
- Parameters:
args – command line arguments
na_domain – domain name
split – whether a training/validation split is performed (the training split portion will be determined by args.split); for test set, no need to split; args.split: by default, split is set to be zero which in python can be evaluated in if statement, in which case, no separate validation set will be created. Otherwise, this argument is the percentage of the data to be used as training set, while the rest will be used as validation set.
- Returns:
training dataset, validation dataset
domid.tasks.task_usps module¶
- class domid.tasks.task_usps.NodeTaskUSPS(succ=None)[source]¶
Bases:
NodeTaskDictCluster
Basic USPS task where the digits are considered “domains”
The digits (0, 1, …, 9) are regarded as domains (to be separated by unsupervised clustering). Based on NodeTaskMNISTColor10 from DomainLab.
- property list_str_y¶
USPS task has no labels (digits are considered domains)
- property isize¶
image size object storing image channels, height, width.
- Type:
return
- get_dset_by_domain(args, na_domain, split=False)[source]¶
Get a dataset by digit
- Parameters:
args – command line arguments
na_domain – domain name
split – whether a training/validation split is performed (the training split portion will be determined by args.split); for test set, no need to split; args.split: by default, split is set to be zero which in python can be evaluated in if statement, in which case, no separate validation set will be created. Otherwise, this argument is the percentage of the data to be used as training set, while the rest will be used as validation set.
- Returns:
training dataset, validation dataset
domid.tasks.task_wsi module¶
- class domid.tasks.task_wsi.NodeTaskWSI(succ=None)[source]¶
Bases:
NodeTaskDictCluster
- property list_str_y¶
WSI task has no labels because it’s used for unsupervised learning (the available annotations are considered domains instead)
- property isize¶
image size object storing image channels, height, width.
- Type:
return
- get_dset_by_domain(args, na_domain, split=True)[source]¶
Get a dataset by ‘domain’
- Parameters:
args – command line arguments
na_domain – domain name
split – whether a training/validation split is performed (the training split portion will be determined by args.split); for test set, no need to split; args.split: by default, split is set to be zero which in python can be evaluated in if statement, in which case, no separate validation set will be created. Otherwise, this argument is the percentage of the data to be used as training set, while the rest will be used as validation set.
- Returns:
training dataset, validation dataset