domid.tasks package

Submodules

domid.tasks.b_task_cluster module

class domid.tasks.b_task_cluster.NodeTaskDictCluster(succ=None)[source]

Bases: NodeTaskDictClassif

Place to include additional functionality for all clustering tasks. Currently inherits from classification tasks, and no further functionality is added.

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_list_domains()[source]

Get list of domain names :return: list of domain names

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

calc_corr(model, loader_tr, loader_te, device)[source]
domid.tasks.task_her2.test_fun()[source]

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_list_domains()[source]

Get list of domain names

Returns:

list of domain names

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.test_fun()[source]

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

init_business(args, trainer=None)[source]

create a dictionary of datasets

property dim_y

classification dimension

property list_str_y

getter for list_str_y

property isize

image channel, height, width

get_list_domains()[source]
  1. get list of domain names

  2. 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_list_domains()[source]

Get list of domain names

Returns:

list of domain names

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_unittest.test_fun()[source]

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_list_domains()[source]

Get list of domain names

Returns:

list of domain names

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.test_fun()[source]

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_list_domains()[source]

Get list of domain names

Returns:

list of domain names

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

domid.tasks.zoo_tasks module

class domid.tasks.zoo_tasks.TaskChainNodeGetter(args)[source]

Bases: object

1. Hardcoded chain 3. Return selected node

__init__(args)[source]

Module contents