class_docstr: Add two or more BNNs, with weights taken from a Dirichlet prior.
docstr: Return a string summarizing the structure of the BNN.
docstr_tok: ["Return","a","string","summarizing","the","structure","of","the","BNN","."]
code: def summarize(self, params=None, full: bool = False) -> str:
      """Return a string summarizing the structure of the BNN."""
      params = params or {}
      if "params" in params:
          params = params["params"]
  
      names = [
          b.summarize(params.get(f"bnns_{i}"), full)
          for i, b in enumerate(self.bnns)
      ]
  
      def pretty_print(w):
          try:
              s = f"{jnp.array_str(jnp.array(w), precision=3)}"
          except Exception:  # pylint: disable=broad-exception-caught
              try:
                  s = f"{w:.3f}"
              except (
                  Exception
              ):  # pylint: disable=broad-exception-caught
                  s = f"{w}"
          return s.replace("\n", " ")
  
      weights = params.get("bnn_weights")
      if weights is not None:
          weights = jnp.array(weights)[0].T.squeeze()
          names = [
              f"{pretty_print(w)} {n}"
              for w, n in zip(weights, names)
              if full or jnp.max(w) > 0.04
          ]
  
      return f'({"+".join(names)})'
  
imports: from typing import Optional
  from flax import linen
  import jax.numpy
  from tensorflow_probability.python.experimental.autobnn import bnn
  from tensorflow_probability.python.experimental.autobnn import likelihoods
  from tensorflow_probability.substrates.jax.bijectors import chain
  from tensorflow_probability.substrates.jax.bijectors import scale
  from tensorflow_probability.substrates.jax.bijectors import shift
  from tensorflow_probability.substrates.jax.distributions import beta
  from tensorflow_probability.substrates.jax.distributions import dirichlet
  from tensorflow_probability.substrates.jax.distributions import half_normal
  from tensorflow_probability.substrates.jax.distributions import normal
  from tensorflow_probability.substrates.jax.distributions import transformed_distribution
label_desc: Use image node_id 4 for calling the WeightedSum obj's underlying member method code with example usage: obj.summarize(params, full) and returns: str, str, str, s