InContextLearningMetric#

class composer.metrics.InContextLearningMetric(**kwargs)[source]#
update(batch, output_logits, labels)[source]#

Abstract interface for computing an in-context learning metrics.

Parameters
  • batch (dict) โ€“ Batch must consist minimally of input_ids as well as any other structure needed to compute the metric.

  • output_logits (Tensor) โ€“ The model outputs evaluated on the batch input_ids

  • labels (Tensor) โ€“ The correct outputs.

Raises

NotImplementedError โ€“ Abstract method must be implemented by subclasses