code: def main(args):
      pyro.set_rng_seed(args.seed)
  
      model = SimpleHarmonicModel(
          args.process_noise, args.measurement_noise
      )
      guide = SimpleHarmonicModel_Guide(model)
  
      smc = SMCFilter(
          model,
          guide,
          num_particles=args.num_particles,
          max_plate_nesting=0,
      )
  
      logging.info("Generating data")
      zs, ys = generate_data(args)
  
      logging.info("Filtering")
  
      smc.init(initial=torch.tensor([1.0, 0.0]))
      for y in ys[1:]:
          smc.step(y)
  
      logging.info("At final time step:")
      z = smc.get_empirical()["z"]
      logging.info("truth: {}".format(zs[-1]))
      logging.info("mean: {}".format(z.mean))
      logging.info("std: {}".format(z.variance**0.5))
  
file_path: pyro/examples/smcfilter.py
imports: import argparse
  import logging
  import torch
  import pyro
  import pyro.distributions
  from pyro.infer import SMCFilter
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types