Compute the lab from the probability of predicted feature maps Args: sigmoid: If the sigmoid function should be used. threshold: threshold value to activate the sigmoid function.
(x: torch.Tensor, sigmoid: bool = False, threshold: float = 0.5, **kwargs: Any)
| 706 | |
| 707 | |
| 708 | def prob2class(x: torch.Tensor, sigmoid: bool = False, threshold: float = 0.5, **kwargs: Any) -> torch.Tensor: |
| 709 | """ |
| 710 | Compute the lab from the probability of predicted feature maps |
| 711 | |
| 712 | Args: |
| 713 | sigmoid: If the sigmoid function should be used. |
| 714 | threshold: threshold value to activate the sigmoid function. |
| 715 | """ |
| 716 | return torch.argmax(x, **kwargs) if not sigmoid else (x > threshold).int() |
| 717 | |
| 718 | |
| 719 | def path_to_uri(path: PathLike) -> str: |
no outgoing calls
no test coverage detected
searching dependent graphs…