anomalib.models.fastflow.lightning_model¶
FastFlow Lightning Model Implementation.
Module Contents¶
Classes¶
PL Lightning Module for the FastFlow algorithm. |
|
PL Lightning Module for the FastFlow algorithm. |
- class anomalib.models.fastflow.lightning_model.Fastflow(input_size: Tuple[int, int], backbone: str, pre_trained: bool = True, flow_steps: int = 8, conv3x3_only: bool = False, hidden_ratio: float = 1.0)[source]¶
Bases:
anomalib.models.components.AnomalyModulePL Lightning Module for the FastFlow algorithm.
- Parameters
input_size (Tuple[int, int]) – Model input size.
backbone (str) – Backbone CNN network
pre_trained (bool, optional) – Boolean to check whether to use a pre_trained backbone.
flow_steps (int, optional) – Flow steps.
conv3x3_only (bool, optinoal) – Use only conv3x3 in fast_flow model. Defaults to False.
hidden_ratio (float, optional) – Ratio to calculate hidden var channels. Defaults to 1.0.
- class anomalib.models.fastflow.lightning_model.FastflowLightning(hparams: Union[omegaconf.DictConfig, omegaconf.ListConfig])[source]¶
Bases:
FastflowPL Lightning Module for the FastFlow algorithm.
- Parameters
hparams (Union[DictConfig, ListConfig]) – Model params
- configure_callbacks()[source]¶
Configure model-specific callbacks.
Note
This method is used for the existing CLI. When PL CLI is introduced, configure callback method will be
deprecated, and callbacks will be configured from either config.yaml file or from CLI.
- configure_optimizers() torch.optim.Optimizer[source]¶
Configures optimizers for each decoder.
Note
This method is used for the existing CLI. When PL CLI is introduced, configure optimizers method will be
deprecated, and optimizers will be configured from either config.yaml file or from CLI.
- Returns
Adam optimizer for each decoder
- Return type
Optimizer