Returns a copy of a dictionary whose values are numpy arrays.
  Copies their values rather than copying references to them.

def deep_copy(numpy_dict):
  """
  Returns a copy of a dictionary whose values are numpy arrays.
  Copies their values rather than copying references to them.
  """
  out = {}
  for key in numpy_dict:
    out[key] = numpy_dict[key].copy()
  return out