code: def make_lfire_classifier(n_theta_samples):
      def lfire_classifier(
          design, trace, observation_labels, target_labels
      ):
          y_dict = {
              l: trace.nodes[l]["value"] for l in observation_labels
          }
          y = torch.cat(list(y_dict.values()), dim=-1)
  
          quadratic_coef = pyro.param(
              "quadratic_coef", torch.zeros(n_theta_samples, 3, 3)
          )
          linear_coef = pyro.param(
              "linear_coef", torch.zeros(n_theta_samples, 3)
          )
          bias = pyro.param("bias", torch.zeros(n_theta_samples))
  
          y_quadratic = y.unsqueeze(-1) * y.unsqueeze(-2)
          return (
              (quadratic_coef * y_quadratic).sum(-1).sum(-1)
              + (linear_coef * y).sum(-1)
              + bias
          )
  
      return lfire_classifier
  
imports: import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.optim
  from pyro.contrib.oed.eig import donsker_varadhan_eig, laplace_eig, lfire_eig, marginal_eig, marginal_likelihood_eig, nmc_eig, posterior_eig, vnmc_eig
  from pyro.contrib.oed.glmm import known_covariance_linear_model
  from pyro.contrib.oed.glmm.guides import LinearModelLaplaceGuide
  from pyro.contrib.oed.util import linear_model_ground_truth
  from pyro.contrib.util import rmv, rvv
  from pyro.infer import Trace_ELBO
  from tests.common import assert_equal
label_desc: Use image node_id 6 for calling a global function with example usage: make_lfire_classifier(n_theta_samples) and returns: lfire_classifier, unknown