code: def main():
      # ✨ Set the types of the stats/indicators.
      # They default to scalars if not specified
      tracker.set_queue("loss.train", 20, True)
      tracker.set_histogram("loss.valid", True)
      tracker.set_scalar("accuracy.valid", True)
  
      # Configurations
      configs = {
          "epochs": 10,
          "train_batch_size": 64,
          "valid_batch_size": 100,
          "use_cuda": True,
          "seed": 5,
          "train_log_interval": 10,
          "learning_rate": 0.01,
      }
  
      is_cuda = configs["use_cuda"] and torch.cuda.is_available()
      if not is_cuda:
          device = torch.device("cpu")
      else:
          device = torch.device(f"cuda:0")
  
      data_transform = transforms.Compose(
          [
              transforms.ToTensor(),
              transforms.Normalize((0.1307,), (0.3081,)),
          ]
      )
  
      train_loader = torch.utils.data.DataLoader(
          datasets.MNIST(
              str(lab.get_data_path()),
              train=True,
              download=True,
              transform=data_transform,
          ),
          batch_size=configs["train_batch_size"],
          shuffle=True,
      )
  
      valid_loader = torch.utils.data.DataLoader(
          datasets.MNIST(
              str(lab.get_data_path()),
              train=False,
              download=True,
              transform=data_transform,
          ),
          batch_size=configs["valid_batch_size"],
          shuffle=False,
      )
  
      model = Net().to(device)
      optimizer = optim.Adam(
          model.parameters(), lr=configs["learning_rate"]
      )
  
      torch.manual_seed(configs["seed"])
  
      # ✨ Create the experiment
      experiment.create(name="mnist_labml_tracker")
  
      # ✨ Save configurations
      experiment.configs(configs)
  
      # ✨ Set PyTorch models for checkpoint saving and loading
      experiment.add_pytorch_models(dict(model=model))
  
      # ✨ Start and monitor the experiment
      with experiment.start():
          #
          for epoch in range(1, configs["epochs"] + 1):
              train(
                  model,
                  optimizer,
                  train_loader,
                  device,
                  configs["train_log_interval"],
              )
              validate(model, valid_loader, device)
              logger.log()
  
      # ✨ Save the models
      experiment.save_checkpoint()
  
file_path: labml/client/test/mnist_tracker.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  import torch.utils.data
  from torchvision import datasets, transforms
  from labml import lab, tracker, experiment, logger
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types