(walker_features, reference_features,
                                exclude_keys=())
return squared_differences
Computes squared differences of features.
Computes squared differences of features.
Computes squared differences of features .
def compute_squared_differences(walker_features, reference_features,
                                exclude_keys=()):
  """Computes squared differences of features."""
  squared_differences = {}
  for k in walker_features:
    if k not in exclude_keys:
      if 'quaternion' not in k:
        squared_differences[k] = np.sum(
            (walker_features[k] - reference_features[k])**2)
      elif 'quaternions' in k:
        quat_dists = bounded_quat_dist(
            walker_features[k], reference_features[k])
        squared_differences[k] = np.sum(quat_dists**2)
      else:
        squared_differences[k] = bounded_quat_dist(
            walker_features[k], reference_features[k])**2

  return squared_differences
def compute_squared_differences ( walker_features , reference_features , exclude_keys = ( ) ) : squared_differences = { } for k in walker_features : if k not in exclude_keys : if 'quaternion' not in k : squared_differences [ k ] = np . sum ( ( walker_features [ k ] - reference_features [ k ] ) ** 2 ) elif 'quaternions' in k : quat_dists = bounded_quat_dist ( walker_features [ k ] , reference_features [ k ] ) squared_differences [ k ] = np . sum ( quat_dists ** 2 ) else : squared_differences [ k ] = bounded_quat_dist ( walker_features [ k ] , reference_features [ k ] ) ** 2 return squared_differences