code: def test_ProfileHMM_smoke(jit):
      # Setup dataset.
      seqs = ["BABBA", "BAAB", "BABBB"]
      alph = "AB"
      dataset = BiosequenceDataset(seqs, "list", alph)
  
      # Infer.
      scheduler = MultiStepLR(
          {
              "optimizer": Adam,
              "optim_args": {"lr": 0.1},
              "milestones": [20, 100, 1000, 2000],
              "gamma": 0.5,
          }
      )
      model = ProfileHMM(
          int(dataset.max_length * 1.1), dataset.alphabet_length
      )
      n_epochs = 5
      batch_size = 2
      losses = model.fit_svi(
          dataset, n_epochs, batch_size, scheduler, jit
      )
  
      assert not np.isnan(losses[-1])
  
      # Evaluate.
      train_lp, test_lp, train_perplex, test_perplex = model.evaluate(
          dataset, dataset, jit
      )
      assert train_lp < 0.0
      assert test_lp < 0.0
      assert train_perplex > 0.0
      assert test_perplex > 0.0
  
file_path: pyro/tests/contrib/mue/test_models.py
imports: import numpy
  import pytest
  import torch
  from torch.optim import Adam
  import pyro
  from pyro.contrib.mue.dataloaders import BiosequenceDataset
  from pyro.contrib.mue.models import FactorMuE, ProfileHMM
  from pyro.optim import MultiStepLR
label_desc: Use image node_id 1 for calling a global function with example usage: test_ProfileHMM_smoke(jit) without return types