domainlab.algos.observers package

Submodules

domainlab.algos.observers.a_observer module

interface for observer + visitor

class domainlab.algos.observers.a_observer.AObVisitor[source]

Bases: object

Observer + Visitor pattern for model selection

abstract accept(trainer)[source]

accept invitation as a visitor

abstract after_all()[source]

After training is done

abstract clean_up()[source]

to be called by a decorator

reset()[source]

reset observer via reset model selector

set_task(task, args, device)[source]

couple observer with task

abstract update(epoch) bool[source]

return True/False whether the trainer should stop training

domainlab.algos.observers.b_obvisitor module

observer and visitor pattern, responsible train, validation, test dispatch performance evaluation to model, dispatch model selection to model selection object

class domainlab.algos.observers.b_obvisitor.ObVisitor(model_sel)[source]

Bases: AObVisitor

Observer + Visitor pattern for model selection

accept(trainer)[source]

accept invitation as a visitor

after_all()[source]

After training is done

cal_oracle_perf()[source]

calculate oracle performance

clean_up()[source]

to be called by a decorator

dump_prediction(model_ld, metric_te)[source]

given the test domain loader, use the loaded model model_ld to predict each instance

property str_metric4msel

string representing the metric used for persisting models on the disk

update(epoch)[source]

return True/False whether the trainer should stop training

domainlab.algos.observers.c_obvisitor_cleanup module

class domainlab.algos.observers.c_obvisitor_cleanup.ObVisitorCleanUp(observer)[source]

Bases: AObVisitor

decorator of observer, instead of using if and else to decide clean up or not, we use decorator

accept(trainer)[source]

accept invitation as a visitor

after_all()[source]

After training is done

clean_up()[source]

to be called by a decorator

property model_sel
update(epoch)[source]

return True/False whether the trainer should stop training

domainlab.algos.observers.c_obvisitor_gen module

class domainlab.algos.observers.c_obvisitor_gen.ObVisitorGen(model_sel)[source]

Bases: ObVisitor

For Generative Models

after_all()[source]

After training is done

Module contents