Skip to content

silhouette_score

SilhouetteScore

Bases: torch.nn.Module

A PyTorch implementation of the silhouette score

Source code in pytorch_adapt\layers\silhouette_score.py
46
47
48
49
50
51
52
53
54
class SilhouetteScore(torch.nn.Module):
    """
    A PyTorch implementation of the
    [silhouette score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.silhouette_score.html)
    """

    def forward(self, features: torch.Tensor, labels: torch.Tensor) -> float:
        """ """
        return get_silhouette_score(features, labels)