code: def make_changepoint_of_safe_products(
      time_series_xs: Array,
      width: int = 5,
      periods: Sequence[float] = (0.1,),
      num_outputs: int = 1,
  ) -> bnn.BNN:
      """Return a changepoint over two Multiply(Linear, WeightedSum(kernels))'s."""
      # By varying the weights inside the WeightedSum (and by relying on the
      # identity Changepoint(A, A) = A), this model can express
      # * all base kernels,
      # * all "safe" multiplies over two base kernels (i.e., one of the terms
      #   has a very low effective parameter count to avoid overfitting noise), and
      # * all single changepoints over two of the above.
  
      all_kernels = [
          kernels.PeriodicBNN(
              width=width, period=p, going_to_be_multiplied=True
          )
          for p in periods
      ]
      all_kernels.extend(
          [
              k(width=width, going_to_be_multiplied=True)
              for k in [
                  kernels.ExponentiatedQuadraticBNN,
                  kernels.MaternBNN,
                  kernels.LinearBNN,
                  kernels.QuadraticBNN,
              ]
          ]
      )
  
      safe_product = operators.Multiply(
          bnns=(
              operators.WeightedSum(
                  num_outputs=num_outputs,
                  bnns=(
                      kernels.IdentityBNN(
                          width=width, going_to_be_multiplied=True
                      ),
                      kernels.LinearBNN(
                          width=width, going_to_be_multiplied=True
                      ),
                      kernels.QuadraticBNN(
                          width=width, going_to_be_multiplied=True
                      ),
                  ),
                  going_to_be_multiplied=True,
              ),
              operators.WeightedSum(
                  bnns=tuple(all_kernels),
                  going_to_be_multiplied=True,
                  num_outputs=num_outputs,
              ),
          ),
      )
  
      return operators.LearnableChangePoint(
          time_series_xs=time_series_xs,
          bnns=(safe_product, safe_product.clone(_deep_clone=True)),
      )
  
file_path: probability/tensorflow_probability/python/experimental/autobnn/models.py
imports: import functools
  from typing import Sequence
  import jax.numpy
  from tensorflow_probability.python.experimental.autobnn import bnn
  from tensorflow_probability.python.experimental.autobnn import bnn_tree
  from tensorflow_probability.python.experimental.autobnn import kernels
  from tensorflow_probability.python.experimental.autobnn import likelihoods
  from tensorflow_probability.python.experimental.autobnn import operators
label_desc: Use image node_id 9 for calling a global function with example usage: make_changepoint_of_safe_products(time_series_xs, width, periods, num_outputs) and returns: operators