Task

A task defines the prediction problem: given a batch index, it loads the relevant shard through a VirtualBatch, selects input features and supervision targets, and returns a (X, y) pair as Awkward Arrays.

Tasks encode what the model should predict — property values, structural classes, binding affinities, inverse-folding sequences, etc. The trainer and collater consume the task output; the metric evaluates predictions against y.

Each benchmark declares exactly one task. Override it in B_*.yaml when the same dataset supports multiple prediction targets. See Tasks.

class bioverse.task.Task[source]

Bases: ABC

Extract model inputs and targets from indexed dataset rows.

A task defines the prediction problem for a benchmark. Given a batch index produced by a Sampler, it loads the relevant shard through a VirtualBatch, selects features X and supervision y, and returns both as Awkward Arrays.

Subclasses implement __call__(). The trainer passes the output to a Collater and the metric compares y with model predictions.

Examples

from bioverse.tasks import PropertyPredictionTask

task = PropertyPredictionTask(property="affinity", level="molecule")
X, y = task(vbatch, assets, index)