class_docstr: Implements the KISS-GP (or SKI) approximation for a given kernel.
  It was proposed in `Kernel Interpolation for Scalable Structured Gaussian Processes`_,
  and offers extremely fast and accurate Kernel approximations for large datasets.
  
  Given a base kernel `k`, the covariance :math:`k(\mathbf{x_1}, \mathbf{x_2})` is approximated by
  using a grid of regularly spaced *inducing points*:
  
  .. math::
  
     \begin{equation*}
        k(\mathbf{x_1}, \mathbf{x_2}) = \mathbf{w_{x_1}}^\top K_{U,U} \mathbf{w_{x_2}}
     \end{equation*}
  
  where
  
  * :math:`U` is the set of gridded inducing points
  
  * :math:`K_{U,U}` is the kernel matrix between the inducing points
  
  * :math:`\mathbf{w_{x_1}}` and :math:`\mathbf{w_{x_2}}` are sparse vectors based on
    :math:`\mathbf{x_1}` and :math:`\mathbf{x_2}` that apply cubic interpolation.
  
  The user should supply the size of the grid (using the grid_size attribute).
  To choose a reasonable grid value, we highly recommend using the
  :func:`gpytorch.utils.grid.choose_grid_size` helper function.
  The bounds of the grid will automatically be determined by data.
  
  (Alternatively, you can hard-code bounds using the grid_bounds, which
  will speed up this kernel's computations.)
  
  .. note::
  
      `GridInterpolationKernel` can only wrap **stationary kernels** (such as RBF, Matern,
      Periodic, Spectral Mixture, etc.)
  
  Args:
      base_kernel (Kernel):
          The kernel to approximate with KISS-GP
      grid_size (Union[int, List[int]]):
          The size of the grid in each dimension.
          If a single int is provided, then every dimension will have the same grid size.
      num_dims (int):
          The dimension of the input data. Required if `grid_bounds=None`
      grid_bounds (tuple(float, float), optional):
          The bounds of the grid, if known (high performance mode).
          The length of the tuple must match the number of dimensions.
          The entries represent the min/max values for each dimension.
      active_dims (tuple of ints, optional):
          Passed down to the `base_kernel`.
  
  .. _Kernel Interpolation for Scalable Structured Gaussian Processes:
      http://proceedings.mlr.press/v37/wilson15.pdf
class_docstr_tok: ["Implements","the","KISS-GP","(","or","SKI",")","approximation","for","a","given","kernel",".","It","was","proposed","in","`","Kernel","Interpolation","for","Scalable","Structured","Gaussian","Processes","`","_",",","and","offers","extremely","fast","and","accurate","Kernel","approximations","for","large","datasets",".","Given","a","base","kernel","`","k","`",",","the","covariance",":","math",":","`","k","(","\\mathbf","{","x_1","}",",","\\mathbf","{","x_2","}",")","`","is","approximated","by","using","a","grid","of","regularly","spaced","*","inducing","points","*",":","..","math",":",":","\\begin","{","equation","*","}","k","(","\\mathbf","{","x_1","}",",","\\mathbf","{","x_2","}",")","=","\\mathbf","{","w_","{","x_1","}","}","^\\top","K_","{","U",",","U","}","\\mathbf","{","w_","{","x_2","}","}","\\end","{","equation","*","}","where","*",":","math",":","`","U","`","is","the","set","of","gridded","inducing","points","*",":","math",":","`","K_","{","U",",","U","}","`","is","the","kernel","matrix","between","the","inducing","points","*",":","math",":","`","\\mathbf","{","w_","{","x_1","}","}","`","and",":","math",":","`","\\mathbf","{","w_","{","x_2","}","}","`","are","sparse","vectors","based","on",":","math",":","`","\\mathbf","{","x_1","}","`","and",":","math",":","`","\\mathbf","{","x_2","}","`","that","apply","cubic","interpolation",".","The","user","should","supply","the","size","of","the","grid","(","using","the","grid_size","attribute",")",".","To","choose","a","reasonable","grid","value",",","we","highly","recommend","using","the",":","func",":","`","gpytorch.utils.grid.choose_grid_size","`","helper","function",".","The","bounds","of","the","grid","will","automatically","be","determined","by","data",".","(","Alternatively",",","you","can","hard-code","bounds","using","the","grid_bounds",",","which","will","speed","up","this","kernel","'s","computations",".",")","..","note",":",":","`","GridInterpolationKernel","`","can","only","wrap","*","*","stationary","kernels","*","*","(","such","as","RBF",",","Matern",",","Periodic",",","Spectral","Mixture",",","etc",".",")","Args",":","base_kernel","(","Kernel",")",":","The","kernel","to","approximate","with","KISS-GP","grid_size","(","Union","[","int",",","List","[","int","]","]",")",":","The","size","of","the","grid","in","each","dimension",".","If","a","single","int","is","provided",",","then","every","dimension","will","have","the","same","grid","size",".","num_dims","(","int",")",":","The","dimension","of","the","input","data",".","Required","if","`","grid_bounds=None","`","grid_bounds","(","tuple","(","float",",","float",")",",","optional",")",":","The","bounds","of","the","grid",",","if","known","(","high","performance","mode",")",".","The","length","of","the","tuple","must","match","the","number","of","dimensions",".","The","entries","represent","the","min\/max","values","for","each","dimension",".","active_dims","(","tuple","of","ints",",","optional",")",":","Passed","down","to","the","`","base_kernel","`",".","..","_Kernel","Interpolation","for","Scalable","Structured","Gaussian","Processes",":","http",":","\/\/proceedings.mlr.press\/v37\/wilson15.pdf"]
code: def prediction_strategy(
      self, train_inputs, train_prior_dist, train_labels, likelihood
  ):
      return InterpolatedPredictionStrategy(
          train_inputs, train_prior_dist, train_labels, likelihood
      )
  
file_path: gpytorch/gpytorch/kernels/grid_interpolation_kernel.py
imports: from typing import List, Optional, Tuple, Union
  import torch
  from linear_operator import to_linear_operator
  from linear_operator.operators import InterpolatedLinearOperator
  from ..models.exact_prediction_strategies import InterpolatedPredictionStrategy
  from ..utils.grid import create_grid
  from ..utils.interpolation import Interpolation
  from .grid_kernel import GridKernel
  from .kernel import Kernel
label_desc: Use image node_id 6 for calling the GridInterpolationKernel obj's underlying member method code with example usage: obj.prediction_strategy(train_inputs, train_prior_dist, train_labels, likelihood) and returns: InterpolatedPredictionStrategy