def _train_autoencoder(self, strategy: "SupervisedTemplate", autoencoder):
        """Trains an autoencoder for the ExpertGate plugin."""
        # Setup autoencoder strategy
        ae_strategy = AETraining(
            model=autoencoder,
            optimizer=SGD(
                autoencoder.parameters(),
                lr=strategy.ae_lr,
                momentum=0.9,
                weight_decay=0.0005,
            ),
            device=strategy.device,
            train_mb_size=strategy.ae_train_mb_size,
            train_epochs=strategy.ae_train_epochs,
            eval_every=-1,
        )

        print("\nTRAINING NEW AUTOENCODER")
        # Train with autoencoder strategy
        ae_strategy.train(strategy.experience)
        print("FINISHED TRAINING NEW AUTOENCODER\n")
Trains an autoencoder for the ExpertGate plugin.
avalanche/training/supervised/expert_gate.py