def fit(
        self,
        x: np.ndarray,
        y: np.ndarray,
        validation_data: np.ndarray | None = None,
        batch_size: int | None = None,
        nb_epochs: int | None = None,
        **kwargs,
    ) -> None:
        """
        Train a model adversarially. See class documentation for more information on the exact procedure.

        :param x: Training data.
        :param y: Labels for the training data.
        :param validation_data: Validation data.
        :param batch_size: Size of batches. Overwrites batch_size defined in __init__ if not None.
        :param nb_epochs: Number of epochs to use for trainings. Overwrites nb_epochs defined in __init__ if not None.
        :param kwargs: Dictionary of framework-specific arguments.
        """
        batch_size_fit: int
        if batch_size is not None:
            batch_size_fit = batch_size
        elif self.batch_size is not None:
            batch_size_fit = self.batch_size
        else:
            raise ValueError("Please provide value for `batch_size`.")

        if nb_epochs is not None:
            nb_epochs_fit: int = nb_epochs
        elif self.nb_epochs is not None:
            nb_epochs_fit = self.nb_epochs
        else:
            raise ValueError("Please provide value for `nb_epochs`.")

        self.trainer.fit(
            x, y, validation_data=validation_data, nb_epochs=nb_epochs_fit, batch_size=batch_size_fit, **kwargs
        )

        Train a model adversarially. See class documentation for more information on the exact procedure.

        :param x: Training data.
        :param y: Labels for the training data.
        :param validation_data: Validation data.
        :param batch_size: Size of batches. Overwrites batch_size defined in __init__ if not None.
        :param nb_epochs: Number of epochs to use for trainings. Overwrites nb_epochs defined in __init__ if not None.
        :param kwargs: Dictionary of framework-specific arguments.
        
art/defences/trainer/adversarial_trainer_madry_pgd.py