code: def main(device="cpu"):
      experiment_dir = pathlib.Path(__file__).resolve().parent
      hparams_file = experiment_dir / "hyperparams.yaml"
      data_folder = "../../samples/ASR"
      data_folder = (experiment_dir / data_folder).resolve()
  
      # Load model hyper parameters:
      with open(hparams_file) as fin:
          hparams = load_hyperpyyaml(fin)
  
      # Dataset creation
      train_data, valid_data = data_prep(data_folder)
  
      # Trainer initialization
      auto_brain = AutoBrain(
          hparams["modules"],
          hparams["opt_class"],
          hparams,
          run_opts={"device": device},
      )
  
      # Training/validation loop
      auto_brain.fit(
          range(hparams["N_epochs"]),
          train_data,
          valid_data,
          train_loader_kwargs=hparams["dataloader_options"],
          valid_loader_kwargs=hparams["dataloader_options"],
      )
      # Evaluation is run separately (now just evaluating on valid data)
      auto_brain.evaluate(valid_data)
  
      # Check if model overfits for integration test
      assert auto_brain.train_loss < 0.08
  
file_path: speechbrain/tests/integration/autoencoder/example_auto_experiment.py
imports: import pathlib
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
label_desc: Use image node_id 2 for calling a global function with example usage: main(device) without return types