Principle:Snorkel team Snorkel Task Operation Definition
| Knowledge Sources | |
|---|---|
| Domains | Multi_Task_Learning, Deep_Learning, Computation_Graphs |
| Last Updated | 2026-02-14 20:00 GMT |
Overview
An abstraction for defining task computation graphs as sequences of named operations over shared module pools.
Description
Task and Operation Definition provides a declarative way to define how data flows through neural network modules for each task in a multi-task model. Instead of hardcoding forward passes, each task is defined as:
- Module Pool: A dictionary of named nn.Module instances (layers, embeddings, etc.)
- Operation Sequence: An ordered list of Operations, each specifying which module to use and where its inputs come from
- Loss Function: How to compute the task-specific loss
- Output Function: How to convert logits to predictions
This architecture enables module sharing across tasks: multiple tasks can reference the same module in the pool while having different operation sequences.
Usage
Use this principle when configuring the computation graph for a MultitaskClassifier. Define Operations to specify data flow and Tasks to bundle them with loss functions and scorers.
Theoretical Basis
A computation graph for task is defined as a DAG of operations:
where is the module referenced by operation and specifies the preceding operations whose outputs are fed in. Module sharing is achieved when for operations in different tasks.