class_docstr: Computes a covariance matrix based on the Polynomial kernel
  between inputs :math:`\mathbf{x_1}` and :math:`\mathbf{x_2}`:
  
  .. math::
      \begin{equation*}
          k_\text{Poly}(\mathbf{x_1}, \mathbf{x_2}) = (\mathbf{x_1}^\top
          \mathbf{x_2} + c)^{d}.
      \end{equation*}
  
  where
  
  * :math:`c` is an offset parameter.
  
  Args:
      offset_prior (:class:`gpytorch.priors.Prior`):
          Prior over the offset parameter (default `None`).
      offset_constraint (Constraint, optional):
          Constraint to place on offset parameter. Default: `Positive`.
      active_dims (list):
          List of data dimensions to operate on.
          `len(active_dims)` should equal `num_dimensions`.
class_docstr_tok: ["Computes","a","covariance","matrix","based","on","the","Polynomial","kernel","between","inputs",":","math",":","`","\\mathbf","{","x_1","}","`","and",":","math",":","`","\\mathbf","{","x_2","}","`",":","..","math",":",":","\\begin","{","equation","*","}","k_\\text","{","Poly","}","(","\\mathbf","{","x_1","}",",","\\mathbf","{","x_2","}",")","=","(","\\mathbf","{","x_1","}","^\\top","\\mathbf","{","x_2","}","+","c",")","^","{","d","}",".","\\end","{","equation","*","}","where","*",":","math",":","`","c","`","is","an","offset","parameter",".","Args",":","offset_prior","(",":","class",":","`","gpytorch.priors.Prior","`",")",":","Prior","over","the","offset","parameter","(","default","`","None","`",")",".","offset_constraint","(","Constraint",",","optional",")",":","Constraint","to","place","on","offset","parameter",".","Default",":","`","Positive","`",".","active_dims","(","list",")",":","List","of","data","dimensions","to","operate","on",".","`","len","(","active_dims",")","`","should","equal","`","num_dimensions","`","."]
code: def __init__(
      self,
      power: int,
      offset_prior: Optional[Prior] = None,
      offset_constraint: Optional[Interval] = None,
      **kwargs,
  ):
      super().__init__(**kwargs)
      if offset_constraint is None:
          offset_constraint = Positive()
  
      self.register_parameter(
          name="raw_offset",
          parameter=torch.nn.Parameter(
              torch.zeros(*self.batch_shape, 1)
          ),
      )
  
      # We want the power to be a float so we dont have to worry about its device / dtype.
      if torch.is_tensor(power):
          if power.numel() > 1:
              raise RuntimeError(
                  "Cant create a Polynomial kernel with more than one power"
              )
          else:
              power = power.item()
  
      self.power = power
  
      if offset_prior is not None:
          if not isinstance(offset_prior, Prior):
              raise TypeError(
                  "Expected gpytorch.priors.Prior but got "
                  + type(offset_prior).__name__
              )
          self.register_prior(
              "offset_prior",
              offset_prior,
              lambda m: m.offset,
              lambda m, v: m._set_offset(v),
          )
  
      self.register_constraint("raw_offset", offset_constraint)
  
file_path: gpytorch/gpytorch/kernels/polynomial_kernel.py
imports: from typing import Optional
  import torch
  from ..constraints import Interval, Positive
  from ..priors import Prior
  from .kernel import Kernel
label_desc: Use image node_id 1 to create a new PolynomialKernel object from inherited base classes: Kernel with example: obj = PolynomialKernel(power, offset_prior, offset_constraint)