code: def main(device="cpu"):
      experiment_dir = os.path.dirname(os.path.abspath(__file__))
      hparams_file = os.path.join(experiment_dir, "hyperparams.yaml")
      data_folder = "/../../samples/VAD"
      data_folder = os.path.abspath(experiment_dir + data_folder)
      with open(hparams_file) as fin:
          hparams = load_hyperpyyaml(fin)
  
      # Data IO creation
      train_data, valid_data = data_prep(data_folder, hparams)
  
      # Trainer initialization
      ctc_brain = VADBrain(
          hparams["modules"],
          hparams["opt_class"],
          hparams,
          run_opts={"device": device},
      )
  
      # Training/validation loop
      ctc_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)
      ctc_brain.evaluate(valid_data)
  
      # Check if model overfits for integration test
      assert ctc_brain.train_loss < 1.0
  
file_path: speechbrain/tests/integration/VAD/example_vad.py
imports: import os
  import torch
  import numpy
  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