peal.adaptors.clarc.calculate_cav¶
- peal.adaptors.clarc.calculate_cav(activations, annotations, projection_type)[source]¶
Dispatch to
calculate_pcav()orcalculate_svm_cav().- Parameters:
activations (
torch.Tensor) – Shape(N, D).annotations (
torch.Tensor) – Shape(N,)with 0 / 1 artifact labels.projection_type (
str) –"pcav"or"svm".
- Returns:
Unit-norm CAV of shape
(1, D)(pcav) or(D,)(svm).- Return type:
- Raises:
NotImplementedError – For other projection types.