domainlab.algos package

Subpackages

Submodules

domainlab.algos.a_algo_builder module

parent class for combing model, trainer, task, observer

class domainlab.algos.a_algo_builder.NodeAlgoBuilder(success_node=None)[source]

Bases: AbstractChainNodeHandler

Base class for Algorithm Builder

extend(node)[source]

Extends the current algorithm builder with a new node.

This method updates the builder by setting the next_model attribute to the specified node.

Parameters:

node – The node to be added to the algorithm builder.

abstract init_business(exp)[source]

combine model, trainer, observer, task

init_next_model(model, exp)[source]

initialize the next model and decorate with current model

is_myjob(request)[source]
Parameters:

request – string

na_prefix = 'NodeAlgoBuilder'
property name

get the name of the algorithm

domainlab.algos.builder_api_model module

build algorithm from API coded model with custom backbone

class domainlab.algos.builder_api_model.NodeAlgoBuilderAPIModel(success_node=None)[source]

Bases: NodeAlgoBuilder

build algorithm from API coded model with custom backbone

init_business(exp)[source]

return trainer, model, observer

domainlab.algos.builder_custom module

domainlab.algos.builder_custom.make_basic_trainer(class_name_model)[source]

make_basic_trainer. :param class_name_model:

domainlab.algos.builder_dann module

builder for Domain Adversarial Neural Network: accept different training scheme

class domainlab.algos.builder_dann.NodeAlgoBuilderDANN(success_node=None)[source]

Bases: NodeAlgoBuilder

init_business(exp)[source]

return trainer, model, observer

reset_aux_net(net_encoder)[source]

reset auxilliary neural network from task note that net_encoder can also be a method like extract_semantic_feat

domainlab.algos.builder_diva module

Builder pattern to build different component for experiment with DIVA

class domainlab.algos.builder_diva.NodeAlgoBuilderDIVA(success_node=None)[source]

Bases: NodeAlgoBuilder

Builder pattern to build different component for experiment with DIVA

get_trainer(args)[source]

chain of responsibility pattern for fetching trainer from dictionary

init_business(exp)[source]

return trainer, model, observer

domainlab.algos.builder_erm module

builder for erm

class domainlab.algos.builder_erm.NodeAlgoBuilderERM(success_node=None)[source]

Bases: NodeAlgoBuilder

builder for erm

init_business(exp)[source]

return trainer, model, observer

domainlab.algos.builder_hduva module

build hduva model, get trainer from cmd arguments

class domainlab.algos.builder_hduva.NodeAlgoBuilderHDUVA(success_node=None)[source]

Bases: NodeAlgoBuilder

init_business(exp)[source]

return trainer, model, observer

domainlab.algos.builder_jigen1 module

builder for JiGen

class domainlab.algos.builder_jigen1.NodeAlgoBuilderJiGen(success_node=None)[source]

Bases: NodeAlgoBuilder

init_business(exp)[source]

return trainer, model, observer

domainlab.algos.utils module

network builder utils

domainlab.algos.utils.split_net_feat_last(net)[source]

split a pytorch module into feature extractor and last layer

domainlab.algos.zoo_algos module

chain of responsibility pattern for algorithm selection

class domainlab.algos.zoo_algos.AlgoBuilderChainNodeGetter(model, apath)[source]

Bases: object

1. Hardcoded chain 3. Return selected node

register_external_node(chain)[source]

if the user specify an external python file to implement the algorithm

Module contents