absoluteError = (targets = [], predictions = []) => {
  if (!targets.length || !predictions.length) {
    return;
  }
  return tf.tidy(() =>
    tf
      .abs(tf.sub(tf.tensor1d(targets), tf.squeeze(tf.tensor2d(predictions))))
      .dataSync()
  );
}
@param {Array} targets - 1-D array of targets
@param {Array} predictions - 2-D array of predictions (second dimension size is 1)
@return 1-D array of errors