def on_train_batch_start(
        self,
        trainer: pl.Trainer,
        pl_module: pl.LightningModule,
        batch: Any,  # noqa: ANN401
        batch_idx: int,
        unused: int = 0,
    ) -> None:
        """Prepare compression before each training batch.

        Called at the beginning of each training batch to update the compression
        scheduler for the next step.

        Args:
            trainer (pl.Trainer): PyTorch Lightning trainer instance
            pl_module (pl.LightningModule): The Lightning module being trained
            batch (Any): Current batch of data
            batch_idx (int): Index of current batch
            unused (int, optional): Unused parameter. Defaults to ``0``.
        """
        del trainer, pl_module, batch, batch_idx, unused  # These variables are not used.

        if self.nncf_ctrl:
            self.nncf_ctrl.scheduler.step()
Prepare compression before each training batch.

        Called at the beginning of each training batch to update the compression
        scheduler for the next step.

        Args:
            trainer (pl.Trainer): PyTorch Lightning trainer instance
            pl_module (pl.LightningModule): The Lightning module being trained
            batch (Any): Current batch of data
            batch_idx (int): Index of current batch
            unused (int, optional): Unused parameter. Defaults to ``0``.
        
src/anomalib/callbacks/nncf/callback.py