class_docstr: Computes a covariance matrix based on the periodic kernel
  between inputs :math:`\mathbf{x_1}` and :math:`\mathbf{x_2}`:
  
  .. math::
  
      \begin{equation*}
          k_{\text{Periodic}}(\mathbf{x}, \mathbf{x'}) = \exp \left(
          -2 \sum_i
          \frac{\sin ^2 \left( \frac{\pi}{p} ({x_{i}} - {x_{i}'} ) \right)}{\lambda}
          \right)
      \end{equation*}
  
  where
  
  * :math:`p` is the period length parameter.
  * :math:`\lambda` is a lengthscale parameter.
  
  Equation is based on `David Mackay's Introduction to Gaussian Processes equation 47`_
  (albeit without feature-specific lengthscales and period lengths). The exponential
  coefficient was changed and lengthscale is not squared to maintain backwards compatibility
  
  .. note::
  
      This kernel does not have an `outputscale` parameter. To add a scaling parameter,
      decorate this kernel with a :class:`gpytorch.kernels.ScaleKernel`.
  
  :param ard_num_dims: (Default: `None`) Set this if you want a separate lengthscale for each
      input dimension. It should be `d` if x1 is a `... x n x d` matrix.
  :type ard_num_dims: int, optional
  :param batch_shape: (Default: `None`) Set this if you want a separate lengthscale for each
       batch of input data. It should be `torch.Size([b1, b2])` for a `b1 x b2 x n x m` kernel output.
  :type batch_shape: torch.Size, optional
  :param active_dims: (Default: `None`) Set this if you want to
      compute the covariance of only a few input dimensions. The ints
      corresponds to the indices of the dimensions.
  :type active_dims: Tuple(int)
  :param period_length_prior: (Default: `None`)
      Set this if you want to apply a prior to the period length parameter.
  :type period_length_prior: ~gpytorch.priors.Prior, optional
  :param period_length_constraint: (Default: `Positive`) Set this if you want
      to apply a constraint to the period length parameter.
  :type period_length_constraint: ~gpytorch.constraints.Interval, optional
  :param lengthscale_prior: (Default: `None`)
      Set this if you want to apply a prior to the lengthscale parameter.
  :type lengthscale_prior: ~gpytorch.priors.Prior, optional
  :param lengthscale_constraint: (Default: `Positive`) Set this if you want
      to apply a constraint to the lengthscale parameter.
  :type lengthscale_constraint: ~gpytorch.constraints.Interval, optional
  :param eps: (Default: 1e-6) The minimum value that the lengthscale can take (prevents divide by zero errors).
  :type eps: float, optional
  
  :var torch.Tensor period_length: The period length parameter. Size/shape of parameter depends on the
      ard_num_dims and batch_shape arguments.
  
  Example:
      >>> x = torch.randn(10, 5)
      >>> # Non-batch: Simple option
      >>> covar_module = gpytorch.kernels.ScaleKernel(gpytorch.kernels.PeriodicKernel())
      >>>
      >>> batch_x = torch.randn(2, 10, 5)
      >>> # Batch: Simple option
      >>> covar_module = gpytorch.kernels.ScaleKernel(gpytorch.kernels.PeriodicKernel())
      >>> # Batch: different lengthscale for each batch
      >>> covar_module = gpytorch.kernels.ScaleKernel(gpytorch.kernels.PeriodicKernel(batch_size=2))
      >>> covar = covar_module(x)  # Output: LazyVariable of size (2 x 10 x 10)
  
  .. _David Mackay's Introduction to Gaussian Processes equation 47:
      http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.81.1927&rep=rep1&type=pdf
class_docstr_tok: ["Computes","a","covariance","matrix","based","on","the","periodic","kernel","between","inputs",":","math",":","`","\\mathbf","{","x_1","}","`","and",":","math",":","`","\\mathbf","{","x_2","}","`",":","..","math",":",":","\\begin","{","equation","*","}","k_","{","\\text","{","Periodic","}","}","(","\\mathbf","{","x","}",",","\\mathbf","{","x","'","}",")","=","\\exp","\\left","(","-2","\\sum_i","\\frac","{","\\sin","^2","\\left","(","\\frac","{","\\pi","}","{","p","}","(","{","x_","{","i","}","}","-","{","x_","{","i","}","'","}",")","\\right",")","}","{","\\lambda","}","\\right",")","\\end","{","equation","*","}","where","*",":","math",":","`","p","`","is","the","period","length","parameter",".","*",":","math",":","`","\\lambda","`","is","a","lengthscale","parameter",".","Equation","is","based","on","`","David","Mackay","'s","Introduction","to","Gaussian","Processes","equation","47","`","_","(","albeit","without","feature-specific","lengthscales","and","period","lengths",")",".","The","exponential","coefficient","was","changed","and","lengthscale","is","not","squared","to","maintain","backwards","compatibility","..","note",":",":","This","kernel","does","not","have","an","`","outputscale","`","parameter",".","To","add","a","scaling","parameter",",","decorate","this","kernel","with","a",":","class",":","`","gpytorch.kernels.ScaleKernel","`",".",":","param","ard_num_dims",":","(","Default",":","`","None","`",")","Set","this","if","you","want","a","separate","lengthscale","for","each","input","dimension",".","It","should","be","`","d","`","if","x1","is","a","`","...","x","n","x","d","`","matrix",".",":","type","ard_num_dims",":","int",",","optional",":","param","batch_shape",":","(","Default",":","`","None","`",")","Set","this","if","you","want","a","separate","lengthscale","for","each","batch","of","input","data",".","It","should","be","`","torch.Size","(","[","b1",",","b2","]",")","`","for","a","`","b1","x","b2","x","n","x","m","`","kernel","output",".",":","type","batch_shape",":","torch.Size",",","optional",":","param","active_dims",":","(","Default",":","`","None","`",")","Set","this","if","you","want","to","compute","the","covariance","of","only","a","few","input","dimensions",".","The","ints","corresponds","to","the","indices","of","the","dimensions",".",":","type","active_dims",":","Tuple","(","int",")",":","param","period_length_prior",":","(","Default",":","`","None","`",")","Set","this","if","you","want","to","apply","a","prior","to","the","period","length","parameter",".",":","type","period_length_prior",":","~gpytorch.priors.Prior",",","optional",":","param","period_length_constraint",":","(","Default",":","`","Positive","`",")","Set","this","if","you","want","to","apply","a","constraint","to","the","period","length","parameter",".",":","type","period_length_constraint",":","~gpytorch.constraints.Interval",",","optional",":","param","lengthscale_prior",":","(","Default",":","`","None","`",")","Set","this","if","you","want","to","apply","a","prior","to","the","lengthscale","parameter",".",":","type","lengthscale_prior",":","~gpytorch.priors.Prior",",","optional",":","param","lengthscale_constraint",":","(","Default",":","`","Positive","`",")","Set","this","if","you","want","to","apply","a","constraint","to","the","lengthscale","parameter",".",":","type","lengthscale_constraint",":","~gpytorch.constraints.Interval",",","optional",":","param","eps",":","(","Default",":","1e-6",")","The","minimum","value","that","the","lengthscale","can","take","(","prevents","divide","by","zero","errors",")",".",":","type","eps",":","float",",","optional",":","var","torch.Tensor","period_length",":","The","period","length","parameter",".","Size\/shape","of","parameter","depends","on","the","ard_num_dims","and","batch_shape","arguments",".","Example",":",">",">",">","x","=","torch.randn","(","10",",","5",")",">",">",">","#","Non-batch",":","Simple","option",">",">",">","covar_module","=","gpytorch.kernels.ScaleKernel","(","gpytorch.kernels.PeriodicKernel","(",")",")",">",">",">",">",">",">","batch_x","=","torch.randn","(","2",",","10",",","5",")",">",">",">","#","Batch",":","Simple","option",">",">",">","covar_module","=","gpytorch.kernels.ScaleKernel","(","gpytorch.kernels.PeriodicKernel","(",")",")",">",">",">","#","Batch",":","different","lengthscale","for","each","batch",">",">",">","covar_module","=","gpytorch.kernels.ScaleKernel","(","gpytorch.kernels.PeriodicKernel","(","batch_size=2",")",")",">",">",">","covar","=","covar_module","(","x",")","#","Output",":","LazyVariable","of","size","(","2","x","10","x","10",")","..","_David","Mackay","'s","Introduction","to","Gaussian","Processes","equation","47",":","http",":","\/\/citeseerx.ist.psu.edu\/viewdoc\/download","?","doi=10.1.1.81.1927","&","rep=rep1","&","type=pdf"]
code: def period_length(self):
      return self.raw_period_length_constraint.transform(
          self.raw_period_length
      )
  
file_path: gpytorch/gpytorch/kernels/periodic_kernel.py
imports: import math
  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 2 for calling the PeriodicKernel obj's underlying member method code with example usage: obj.period_length() and returns: self