snorkel.classification.Task¶
-
class
snorkel.classification.Task(name, module_pool, op_sequence, scorer=<snorkel.analysis.scorer.Scorer object>, loss_func=None, output_func=None)[source]¶ Bases:
objectA single task (a collection of modules and specified path through them).
- Parameters
name (
str) – The name of the taskmodule_pool (
ModuleDict) – A ModuleDict mapping module names to the modules themselvesop_sequence (
Sequence[Operation]) – A list ofOperations to execute in order, defining the flow of information through the network for this taskscorer (
Scorer) – AScorerwith the desired metrics to calculate for this taskloss_func (
Optional[Callable[…,Tensor]]) – A function that converts final logits into loss values. Defaults to F.cross_entropy() if none is provided. To use probalistic labels for training, use the Snorkel-defined method cross_entropy_with_probs() instead.output_func (
Optional[Callable[…,Tensor]]) – A function that converts final logits into ‘outputs’ (e.g. probabilities) Defaults to F.softmax(…, dim=1).
-
__init__(name, module_pool, op_sequence, scorer=<snorkel.analysis.scorer.Scorer object>, loss_func=None, output_func=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
- Return type
None
Methods
__init__(name, module_pool, op_sequence[, …])Initialize self.