nemo_automodel.recipes.retrieval.train_cross_encoder
nemo_automodel.recipes.retrieval.train_cross_encoder
Module Contents
Classes
Functions
API
Bases: TrainBiEncoderRecipe
Forward and backward pass for a single micro-batch.
Run validation for one epoch and compute loss, accuracy@1, and MRR.
Validate the effective temperature applied by the constructed model.
Reject simultaneous recipe-level and model-level temperature scaling.
Parameters:
recipe_temperature
Temperature applied by the cross-encoder recipe.
model_temperature
Temperature applied by the loaded model.
Raises:
ValueError: If both temperatures are non-unit.
Returns (num_correct, batch_size) for top-1 accuracy.
Returns sum of reciprocal ranks for the batch. Stays on GPU.