class_docstr: Implements the Weighted Kappa loss function.
  
  Weighted Kappa loss was introduced in the
  [Weighted kappa loss function for multi-class classification
  of ordinal data in deep learning]
  (https://www.sciencedirect.com/science/article/abs/pii/S0167865517301666).
  Weighted Kappa is widely used in Ordinal Classification Problems.
  The loss value lies in $ [-\infty, \log 2] $, where $ \log 2 $
  means the random prediction.
  
  Usage:
  
  >>> kappa_loss = tfa.losses.WeightedKappaLoss(num_classes=4)
  >>> y_true = tf.constant([[0, 0, 1, 0], [0, 1, 0, 0],
  ...                  [1, 0, 0, 0], [0, 0, 0, 1]])
  >>> y_pred = tf.constant([[0.1, 0.2, 0.6, 0.1], [0.1, 0.5, 0.3, 0.1],
  ...                  [0.8, 0.05, 0.05, 0.1], [0.01, 0.09, 0.1, 0.8]])
  >>> loss = kappa_loss(y_true, y_pred)
  >>> loss
  <tf.Tensor: shape=(), dtype=float32, numpy=-1.1611925>
  
  Usage with `tf.keras` API:
  
  >>> model = tf.keras.Model()
  >>> model.compile('sgd', loss=tfa.losses.WeightedKappaLoss(num_classes=4))
  
  <... outputs should be softmax results
  if you want to weight the samples, just multiply the outputs
  by the sample weight ...>
code: def get_config(self):
      config = {
          "num_classes": self.num_classes,
          "weightage": self.weightage,
          "epsilon": self.epsilon,
      }
      base_config = super().get_config()
      return {**base_config, **config}
  
file_path: addons/tensorflow_addons/losses/kappa_loss.py
imports: from typing import Optional
  import tensorflow
  from typeguard import typechecked
  from tensorflow_addons.utils.types import Number
label_desc: Use image node_id 3 for calling the WeightedKappaLoss obj's underlying member method code with example usage: obj.get_config() and returns: dict