class_docstr: GPyTorch Downsampling Kernel.
  
  Computes a covariance matrix based on the down sampling kernel between
  inputs `x_1` and `x_2` (we expect `d = 1`):
  
      K(\mathbf{x_1}, \mathbf{x_2}) = c + (1 - x_1)^(1 + delta) *
          (1 - x_2)^(1 + delta).
  
  where `c` is an offset parameter, and `delta` is a power parameter.
class_docstr_tok: ["GPyTorch","Downsampling","Kernel",".","Computes","a","covariance","matrix","based","on","the","down","sampling","kernel","between","inputs","`","x_1","`","and","`","x_2","`","(","we","expect","`","d","=","1","`",")",":","K","(","\\mathbf","{","x_1","}",",","\\mathbf","{","x_2","}",")","=","c","+","(","1","-","x_1",")","^","(","1","+","delta",")","*","(","1","-","x_2",")","^","(","1","+","delta",")",".","where","`","c","`","is","an","offset","parameter",",","and","`","delta","`","is","a","power","parameter","."]
docstr: Args:
      power_constraint: Constraint to place on power parameter. Default is
          `Positive`.
      power_prior: Prior over the power parameter.
      offset_constraint: Constraint to place on offset parameter. Default is
          `Positive`.
      active_dims: List of data dimensions to operate on. `len(active_dims)`
          should equal `num_dimensions`.
docstr_tok: ["Args",":","power_constraint",":","Constraint","to","place","on","power","parameter",".","Default","is","`","Positive","`",".","power_prior",":","Prior","over","the","power","parameter",".","offset_constraint",":","Constraint","to","place","on","offset","parameter",".","Default","is","`","Positive","`",".","active_dims",":","List","of","data","dimensions","to","operate","on",".","`","len","(","active_dims",")","`","should","equal","`","num_dimensions","`","."]
code: def __init__(
      self,
      power_prior: Optional[Prior] = None,
      offset_prior: Optional[Prior] = None,
      power_constraint: Optional[Interval] = None,
      offset_constraint: Optional[Interval] = None,
      **kwargs,
  ):
      r"""
      Args:
          power_constraint: Constraint to place on power parameter. Default is
              `Positive`.
          power_prior: Prior over the power parameter.
          offset_constraint: Constraint to place on offset parameter. Default is
              `Positive`.
          active_dims: List of data dimensions to operate on. `len(active_dims)`
              should equal `num_dimensions`.
      """
      super().__init__(**kwargs)
  
      if power_constraint is None:
          power_constraint = Positive()
      if offset_constraint is None:
          offset_constraint = Positive()
  
      self.register_parameter(
          name="raw_power",
          parameter=torch.nn.Parameter(
              torch.zeros(*self.batch_shape, 1)
          ),
      )
  
      self.register_parameter(
          name="raw_offset",
          parameter=torch.nn.Parameter(
              torch.zeros(*self.batch_shape, 1)
          ),
      )
  
      if power_prior is not None:
          self.register_prior(
              "power_prior",
              power_prior,
              lambda m: m.power,
              lambda m, v: m._set_power(v),
          )
      self.register_constraint("raw_power", power_constraint)
  
      if offset_prior is not None:
          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: botorch/botorch/models/kernels/downsampling.py
imports: from __future__ import annotations
  from typing import Optional
  import torch
  from gpytorch.constraints import Interval, Positive
  from gpytorch.kernels import Kernel
  from gpytorch.priors import Prior
  from torch import Tensor
label_desc: Use image node_id 1 to create a new DownsamplingKernel object from inherited base classes: Kernel with example: obj = DownsamplingKernel(power_prior, offset_prior, power_constraint, offset_constraint)