class_docstr: Base class for streaming correlation metrics.
  
  Based on https://arxiv.org/abs/1712.01521.
  
  It stores and updates the joint and marginal histograms of (`y_true`, `y_pred`).
  
  The concrete classes estimate the different correlation metrics
  based on those histograms.
class_docstr_tok: ["Base","class","for","streaming","correlation","metrics",".","Based","on","https",":","\/\/arxiv.org\/abs\/1712.01521",".","It","stores","and","updates","the","joint","and","marginal","histograms","of","(","`","y_true","`",",","`","y_pred","`",")",".","The","concrete","classes","estimate","the","different","correlation","metrics","based","on","those","histograms","."]
docstr: Updates `m`, `nrow`, `ncol` respectively the joint and
  marginal histograms of (`y_true`, `y_pred`)
docstr_tok: ["Updates","`","m","`",",","`","nrow","`",",","`","ncol","`","respectively","the","joint","and","marginal","histograms","of","(","`","y_true","`",",","`","y_pred","`",")"]
code: def update_state(self, y_true, y_pred, sample_weight=None):
      """Updates `m`, `nrow`, `ncol` respectively the joint and
      marginal histograms of (`y_true`, `y_pred`)
      """
  
      y_true = tf.clip_by_value(
          y_true, self.actual_min, self.actual_max
      )
      y_pred = tf.clip_by_value(y_pred, self.preds_min, self.preds_max)
  
      i = (
          tf.searchsorted(
              self.actual_cuts,
              tf.cast(tf.reshape(y_true, [-1]), self.actual_cuts.dtype),
              side="right",
              out_type=tf.int64,
          )
          - 1
      )
      j = (
          tf.searchsorted(
              self.preds_cuts,
              tf.cast(tf.reshape(y_pred, [-1]), self.preds_cuts.dtype),
              side="right",
              out_type=tf.int64,
          )
          - 1
      )
  
      nrow = tf.tensor_scatter_nd_add(
          self.nrow, tf.expand_dims(i, axis=-1), tf.ones_like(i)
      )
      ncol = tf.tensor_scatter_nd_add(
          self.ncol, tf.expand_dims(j, axis=-1), tf.ones_like(j)
      )
      ij = tf.stack([i, j], axis=1)
      m = tf.tensor_scatter_nd_add(self.m, ij, tf.ones_like(i))
  
      self.n.assign_add(tf.shape(i, out_type=tf.int64)[0])
      self.m.assign(m)
      self.nrow.assign(nrow)
      self.ncol.assign(ncol)
  
imports: from abc import abstractmethod
  import numpy
  import tensorflow
  from tensorflow.keras import backend
  from tensorflow.keras.metrics import Metric
  from tensorflow_addons.utils.types import AcceptableDTypes
  from typeguard import typechecked
label_desc: Use image node_id 2 for calling the CorrelationBase obj's underlying member method code with example usage: obj.update_state(y_true, y_pred, sample_weight) without return types