def fit(self, X, y=None):
        """Fit the model to the data.

        Parameters
        ----------
        X : numpy.ndarray
            Input data.

        y : None
            Ignored, present for API consistency by convention.

        Returns
        -------
        self : object
            Fitted estimator.
        """
        X = check_array(X)
        self._set_n_classes(y)

        n_samples, n_features = X.shape
        if self.preprocessing:
            self.mean, self.std = np.mean(X, axis=0), np.std(X, axis=0)
            self.std[self.std == 0] = 1e-6  # Avoid division by zero
            train_set = TorchDataset(X=X, mean=self.mean, std=self.std,
                                     return_idx=True)
        else:
            train_set = TorchDataset(X=X, return_idx=True)

        train_loader = torch.utils.data.DataLoader(train_set,
                                                   batch_size=self.batch_size,
                                                   shuffle=True)
        self.model = InnerAE1SVM(n_features=n_features, encoding_dim=32,
                                 rff_dim=self.kernel_approx_features,
                                 sigma=self.sigma,
                                 hidden_neurons=self.hidden_neurons,
                                 dropout_rate=self.dropout_rate,
                                 batch_norm=self.batch_norm,
                                 hidden_activation=self.hidden_activation)
        self.model = self.model.to(self.device)
        self._train_autoencoder(train_loader)

        if self.best_model_dict is not None:
            self.model.load_state_dict(self.best_model_dict)
        else:
            raise ValueError('Training failed, no valid model state found')

        if not isinstance(X, np.ndarray):
            X = np.array(X)

        self.decision_scores_ = self.decision_function(X)
        self._process_decision_scores()
        return self
Fit the model to the data.

        Parameters
        ----------
        X : numpy.ndarray
            Input data.

        y : None
            Ignored, present for API consistency by convention.

        Returns
        -------
        self : object
            Fitted estimator.
        
pyod/models/ae1svm.py