code: def main(args):
      hasWingsERP = structured_prior_model(
          Params(theta=0.5, gamma=0.99, delta=10.0)
      )
      laysEggsERP = structured_prior_model(
          Params(theta=0.5, gamma=0.5, delta=10.0)
      )
      carriesMalariaERP = structured_prior_model(
          Params(theta=0.1, gamma=0.01, delta=2.0)
      )
      areFemaleERP = structured_prior_model(
          Params(theta=0.99, gamma=0.5, delta=50.0)
      )
  
      # listener interpretation of generics
      wingsPosterior = listener1("generic is true", hasWingsERP)
      malariaPosterior = listener1("generic is true", carriesMalariaERP)
      eggsPosterior = listener1("generic is true", laysEggsERP)
      femalePosterior = listener1("generic is true", areFemaleERP)
      listeners = {
          "wings": wingsPosterior,
          "malaria": malariaPosterior,
          "eggs": eggsPosterior,
          "female": femalePosterior,
      }
  
      for name, listener in listeners.items():
          for elt in listener.enumerate_support():
              print(name, elt, listener.log_prob(elt).exp().item())
  
      # truth judgments
      malariaSpeaker = speaker2(0.1, carriesMalariaERP)
      eggSpeaker = speaker2(0.6, laysEggsERP)
      femaleSpeaker = speaker2(0.5, areFemaleERP)
      lionSpeaker = speaker2(0.01, laysEggsERP)
      speakers = {
          "malaria": malariaSpeaker,
          "egg": eggSpeaker,
          "female": femaleSpeaker,
          "lion": lionSpeaker,
      }
  
      for name, speaker in speakers.items():
          for elt in speaker.enumerate_support():
              print(name, elt, speaker.log_prob(elt).exp().item())
  
file_path: pyro/examples/rsa/generics.py
imports: import argparse
  import collections
  import numbers
  import torch
  from search_inference import HashingMarginal, Search, memoize
  import pyro
  import pyro.distributions
  import pyro.poutine
label_desc: Use image node_id 11 for calling a global function with example usage: main(args) without return types