MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / class_score

Method class_score

monai/visualize/class_activation_maps.py:127–128  ·  view source on GitHub ↗
(self, logits: torch.Tensor, class_idx: int)

Source from the content-addressed store, hash-verified

125 raise NotImplementedError(f"Could not find {layer_id}.")
126
127 def class_score(self, logits: torch.Tensor, class_idx: int) -> torch.Tensor:
128 return logits[:, class_idx].squeeze()
129
130 def __call__(self, x, class_idx=None, retain_graph=False, **kwargs):
131 train = self.model.training

Callers 1

__call__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected