tensorflow_similarity/callbacks.py [47:91]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        distance: str = "cosine",
        metrics: Sequence[Union[str, ClassificationMetric]] = [
            "binary_accuracy",
            "f1score",
        ],  # noqa
        tb_logdir: str = None,
        k: int = 1,
        matcher: Union[str, ClassificationMatch] = "match_nearest",
        distance_thresholds: Optional[FloatTensor] = None,
    ):
        """Evaluate model matching quality against a validation dataset at
        epoch end.

        Args:
            queries: Test examples that will be tested against the built index.

            query_labels: Queries nearest neighbors expected labels.

            targets: Examples that are indexed.

            target_labels: Target examples labels.

            distance: Distance function used to compute pairwise distance
            between examples embeddings.

            metrics: List of
            'tf.similarity.classification_metrics.ClassificationMetric()` to
            compute during the evaluation. Defaults to ['binary_accuracy',
            'f1score'].

            tb_logdir: Where to write TensorBoard logs. Defaults to None.

            k: The number of nearest neighbors to return for each query.

            matcher: {'match_nearest', 'match_majority_vote'} or
            ClassificationMatch object. Defines the classification matching,
            e.g., match_nearest will count a True Positive if the query_label is
            equal to the label of the nearest neighbor and the distance is less
            than or equal to the distance threshold.

            distance_thresholds: A 1D tensor denoting the distances points at
            which we compute the metrics. If None, distance_thresholds is set to
            tf.constant([math.inf])
        """
        super().__init__()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tensorflow_similarity/callbacks.py [183:230]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        distance: str = "cosine",
        metrics: Sequence[Union[str, ClassificationMetric]] = [
            "binary_accuracy",
            "f1score",
        ],  # noqa
        tb_logdir: str = None,
        k: int = 1,
        matcher: Union[str, ClassificationMatch] = "match_nearest",
        distance_thresholds: Optional[FloatTensor] = None,
    ):
        """Creates the validation callbacks.

        Args:
            queries: Test examples that will be tested against the built index.

            query_labels: Queries nearest neighbors expected labels.

            targets: Examples that are indexed.

            target_labels: Target examples labels.

            known_classes: The set of classes seen during training.

            distance: Distance function used to compute pairwise distance
            between examples embeddings.

            metrics: List of
            'tf.similarity.classification_metrics.ClassificationMetric()` to
            compute during the evaluation. Defaults to ['binary_accuracy',
            'f1score'].

            tb_logdir: Where to write TensorBoard logs. Defaults to None.

            k: The number of nearest neighbors to return for each query. The
            lookups are consumed by the Matching Strategy and used to derive the
            matching label and distance.

            matcher: {'match_nearest', 'match_majority_vote'} or
            ClassificationMatch object. Defines the classification matching,
            e.g., match_nearest will count a True Positive if the query_label
            is equal to the label of the nearest neighbor and the distance is
            less than or equal to the distance threshold.

            distance_thresholds: A 1D tensor denoting the distances points at
            which we compute the metrics. If None, distance_thresholds is set to
            tf.constant([math.inf])
        """
        super().__init__()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



