- class finetuner.tuner.callback.evaluation.EvaluationCallback(query_data, index_data=None, metrics=None, exclude_self=True, limit=20, distance='cosine', num_workers=1)#
A callback that uses the Evaluator to calculate IR metrics at the end of each epoch. When used with other callbacks that rely on metrics, like checkpoints and logging, this callback should be defined first, so that it precedes in execution.
query_data (DocumentArray) – Search data used by the evaluator at the end of each epoch, to evaluate the model.
ForwardRef]) – Index data or catalog used by the evaluator at the end of each epoch, to evaluate the model.
Any]]]]) – A dictionary that specifies the metrics to calculate. It maps metric names to tuples of metric functions and their keyword arguments. If set to None, default metrics are computed.
bool) – Whether to exclude self when matching.
int) – The number of top search results to consider when computing the evaluation metrics.
str) – The type of distance metric to use when matching query and index docs, available options are
int) – The number of workers to use when matching query and index data.
Called at the start of the
fitmethod call, after all setup has been done, but before the training has started.
Called at the end of an epoch, after both training and validation (or just training if no validaton is provided).