anomalib.models.fastflow.loss¶
Loss function for the FastFlow Model Implementation.
Module Contents¶
Classes¶
FastFlow Loss. |
- class anomalib.models.fastflow.loss.FastflowLoss[source]¶
Bases:
torch.nn.ModuleFastFlow Loss.
- forward(hidden_variables: List[torch.Tensor], jacobians: List[torch.Tensor]) torch.Tensor[source]¶
Calculate the Fastflow loss.
- Parameters
hidden_variables (List[Tensor]) – Hidden variables from the fastflow model. f: X -> Z
jacobians (List[Tensor]) – Log of the jacobian determinants from the fastflow model.
- Returns
Fastflow loss computed based on the hidden variables and the log of the Jacobians.
- Return type
Tensor