def standardize_numpy(x, mean=None, std=None):
    """Standardize the original data set. Works on numpy arrays."""
    if mean is None: mean = x.mean(axis=0, keepdims=True)
    x = x - mean
    if std is None: std = x.std(axis=0, keepdims=True)
    x = x / std
    return x, mean, std