class_docstr: Compute Geometric Mean
  
  The geometric mean is a kind of mean. Unlike the arithmetic mean
  that uses the sum of values, it uses the product of the values to
  represent typical values in a set of numbers.
  
  Note: `tfa.metrics.GeometricMean` can be used the same as `tf.keras.metrics.Mean`.
  
  Args:
      name: (Optional) String name of the metric instance.
      dtype: (Optional) Data type of the metric result.
  
  Usage:
  
  >>> metric = tfa.metrics.GeometricMean()
  >>> metric.update_state([1, 3, 5, 7, 9])
  >>> metric.result().numpy()
  3.9362833
class_docstr_tok: ["Compute","Geometric","Mean","The","geometric","mean","is","a","kind","of","mean",".","Unlike","the","arithmetic","mean","that","uses","the","sum","of","values",",","it","uses","the","product","of","the","values","to","represent","typical","values","in","a","set","of","numbers",".","Note",":","`","tfa.metrics.GeometricMean","`","can","be","used","the","same","as","`","tf.keras.metrics.Mean","`",".","Args",":","name",":","(","Optional",")","String","name","of","the","metric","instance",".","dtype",":","(","Optional",")","Data","type","of","the","metric","result",".","Usage",":",">",">",">","metric","=","tfa.metrics.GeometricMean","(",")",">",">",">","metric.update_state","(","[","1",",","3",",","5",",","7",",","9","]",")",">",">",">","metric.result","(",")",".numpy","(",")","3.9362833"]
code: def update_state(self, values, sample_weight=None) -> None:
      values = tf.cast(values, dtype=self.dtype)
      sample_weight = sample_weight_shape_match(values, sample_weight)
      sample_weight = tf.cast(sample_weight, dtype=self.dtype)
  
      self.count.assign_add(tf.reduce_sum(sample_weight))
      if not tf.math.is_inf(self.total):
          log_v = tf.math.log(values)
          log_v = tf.math.multiply(sample_weight, log_v)
          log_v = tf.reduce_sum(log_v)
          self.total.assign_add(log_v)
  
file_path: addons/tensorflow_addons/metrics/geometric_mean.py
imports: import tensorflow
  from tensorflow.keras import backend
  from tensorflow.keras.metrics import Metric
  from typeguard import typechecked
  from tensorflow_addons.utils.types import AcceptableDTypes
  from tensorflow_addons.metrics.utils import sample_weight_shape_match
label_desc: Use image node_id 2 for calling the GeometricMean obj's underlying member method code with example usage: obj.update_state(values, sample_weight) without return types