class_docstr: A generic polynomial mean function.
class_docstr_tok: ["A","generic","polynomial","mean","function","."]
docstr: :param degree: The degree of the polynomial.
  :param input_dim: Number of inputs / variables this polynomial is defined over.
  :param output_dim: Number of outputs / polynomials.
  :param w: Initial weights of the terms of the polynomial. The inner dimension (``n_terms``)
      should correspond to the powers returned by ``compute_powers``.
docstr_tok: [":","param","degree",":","The","degree","of","the","polynomial",".",":","param","input_dim",":","Number","of","inputs","\/","variables","this","polynomial","is","defined","over",".",":","param","output_dim",":","Number","of","outputs","\/","polynomials",".",":","param","w",":","Initial","weights","of","the","terms","of","the","polynomial",".","The","inner","dimension","(","``","n_terms","``",")","should","correspond","to","the","powers","returned","by","``","compute_powers","``","."]
code: def __init__(
      self,
      degree: int,
      input_dim: int = 1,
      output_dim: int = 1,
      w: Optional[TensorType] = None,
  ) -> None:
      """
      :param degree: The degree of the polynomial.
      :param input_dim: Number of inputs / variables this polynomial is defined over.
      :param output_dim: Number of outputs / polynomials.
      :param w: Initial weights of the terms of the polynomial. The inner dimension (``n_terms``)
          should correspond to the powers returned by ``compute_powers``.
      """
      powers = cs(
          tuple(self.compute_powers(degree, input_dim)),
          "[n_terms, input_dim]",
      )
      if w is None:
          w = cs([1.0] + (len(powers) - 1) * [0.0], "[n_terms]")
      w_shape = (output_dim, len(powers))
      self.powers = tf.constant(powers, dtype=default_float())
      self.w = Parameter(tf.broadcast_to(w, w_shape))
  
imports: from typing import Collection, Optional, Sequence, Tuple
  import numpy
  import tensorflow
  from check_shapes import check_shape
  from check_shapes import check_shapes, inherit_check_shapes
  from .base import Module, Parameter, TensorType
  from .config import default_float, default_int
label_desc: Use image node_id 1 to create a new Polynomial object from inherited base classes: MeanFunction, Function with example: obj = Polynomial(degree, input_dim, output_dim, w)