{"record":{"id":"8656dd64aa05db9e","repo":"tensorflow/models","slug":"likelihood-must-be-one-of-supported-likelihood","errorCode":null,"errorMessage":"\"likelihood\" must be one of {_SUPPORTED_LIKELIHOOD}, got {likelihood}.","messagePattern":"\"likelihood\" must be one of (.+?), got (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/nlp/modeling/layers/gaussian_process.py","lineNumber":299,"sourceCode":"      covariance matrix by passing through data once (say in the final epoch).\n    ridge_penalty: (float) Initial Ridge penalty to weight covariance matrix.\n      This value is used to stablize the eigenvalues of weight covariance\n      estimate so that the matrix inverse can be computed for Cov = inv(t(X) * X\n      + s * I). The ridge factor s cannot be too large since otherwise it will\n      dominate the t(X) * X term and make covariance estimate not meaningful.\n    likelihood: (str) The likelihood to use for computing Laplace approximation\n      for the covariance matrix. Can be one of ('binary_logistic', 'poisson',\n      'gaussian').\n  \"\"\"\n\n  def __init__(self,\n               momentum=0.999,\n               ridge_penalty=1.,\n               likelihood='gaussian',\n               dtype=None,\n               name='laplace_covariance'):\n    if likelihood not in _SUPPORTED_LIKELIHOOD:\n      raise ValueError(\n          f'\"likelihood\" must be one of {_SUPPORTED_LIKELIHOOD}, got {likelihood}.'\n      )\n    self.ridge_penalty = ridge_penalty\n    self.momentum = momentum\n    self.likelihood = likelihood\n    super(LaplaceRandomFeatureCovariance, self).__init__(dtype=dtype, name=name)\n\n  def compute_output_shape(self, input_shape):\n    gp_feature_dim = input_shape[-1]\n    return tf.TensorShape([gp_feature_dim, gp_feature_dim])\n\n  def build(self, input_shape):\n    gp_feature_dim = input_shape[-1]\n\n    # Convert gp_feature_dim to int value for TF1 compatibility.\n    if isinstance(gp_feature_dim, tf.compat.v1.Dimension):\n      gp_feature_dim = gp_feature_dim.value\n","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/nlp/modeling/layers/gaussian_process.py#L281-L317","documentation":"Error \"\"likelihood\" must be one of {_SUPPORTED_LIKELIHOOD}, got {likelihood}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/nlp/modeling/layers/gaussian_process.py:299 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}