code: def main(args):
      # Config
      device = torch.device(
          f"cuda:{args.cuda}"
          if torch.cuda.is_available() and args.cuda >= 0
          else "cpu"
      )
      # model
      model = MTSimpleMLP()
  
      # CL Benchmark Creation
      benchmark = SplitMNIST(n_experiences=5, return_task_id=True)
      train_stream = benchmark.train_stream
      test_stream = benchmark.test_stream
  
      # Prepare for training & testing
      optimizer = Adam(model.parameters(), lr=0.01)
      criterion = CrossEntropyLoss()
  
      # choose some metrics and evaluation method
      interactive_logger = InteractiveLogger()
  
      eval_plugin = EvaluationPlugin(
          accuracy_metrics(
              minibatch=False, epoch=True, experience=True, stream=True
          ),
          forgetting_metrics(experience=True),
          loggers=[interactive_logger],
      )
  
      # Choose a CL strategy
      strategy = EWC(
          model=model,
          optimizer=optimizer,
          criterion=criterion,
          train_mb_size=128,
          train_epochs=3,
          eval_mb_size=128,
          device=device,
          evaluator=eval_plugin,
          ewc_lambda=0.4,
      )
  
      # train and test loop
      for train_task in train_stream:
          strategy.train(train_task, num_workers=4)
          strategy.eval(test_stream, num_workers=4)
  
file_path: avalanche/examples/multihead.py
imports: import argparse
  import torch
  from torch.nn import CrossEntropyLoss
  from torch.optim import Adam
  from avalanche.benchmarks.classic import SplitMNIST
  from avalanche.models import MTSimpleMLP
  from avalanche.training.supervised import EWC
  from avalanche.evaluation.metrics import forgetting_metrics, accuracy_metrics
  from avalanche.logging import InteractiveLogger
  from avalanche.training.plugins import EvaluationPlugin
label_desc: Use image node_id 1 for calling a global function with example usage: main(args) without return types