class_docstr: Base class for coding experiment.
class_docstr_tok: ["Base","class","for","coding","experiment","."]
code: def distortion_fn(self, reference, reconstruction):
      reference = tf.cast(reference, self.dtype)
      if self.distortion_loss == "sse":
          diff = tf.math.squared_difference(reference, reconstruction)
          return tf.math.reduce_sum(diff, axis=-1)
      if self.distortion_loss == "mse":
          diff = tf.math.squared_difference(reference, reconstruction)
          return tf.math.reduce_mean(diff, axis=-1)
  
file_path: compression/models/toy_sources/compression_model.py
imports: import abc
  import matplotlib.pyplot
  import numpy
  import tensorflow
label_desc: Use image node_id 6 for calling the CompressionModel obj's underlying member method code with example usage: obj.distortion_fn(reference, reconstruction) and returns: tf, tf