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 = SimpleMLP(num_classes=10)
  
      # CL Benchmark Creation
      perm_mnist = PermutedMNIST(n_experiences=5)
      train_stream = perm_mnist.train_stream
      test_stream = perm_mnist.test_stream
  
      # Prepare for training & testing
      optimizer = SGD(model.parameters(), lr=0.001, momentum=0.9)
      criterion = CrossEntropyLoss()
  
      # Joint training strategy
      joint_train = JointTraining(
          model,
          optimizer,
          criterion,
          train_mb_size=32,
          train_epochs=1,
          eval_mb_size=32,
          device=device,
      )
  
      # train and test loop
      results = []
      print("Starting training.")
      # Differently from other avalanche strategies, you NEED to call train
      # on the entire stream.
      joint_train.train(train_stream)
      results.append(joint_train.eval(test_stream))
  
file_path: avalanche/examples/joint_training.py
imports: import argparse
  import torch
  from torch.nn import CrossEntropyLoss
  from torch.optim import SGD
  from avalanche.benchmarks.classic import PermutedMNIST
  from avalanche.models import SimpleMLP
  from avalanche.training.supervised import JointTraining
label_desc: Use image node_id 1 for calling a global function with example usage: main(args) without return types