def z_score(input_data, axis = None):
    """ compute the z score for a given input matrix and axis """
    input_mean = input_data.mean(axis = axis, keepdims = True)
    input_std  = input_data.std(axis = axis, keepdims = True)

    return (input_data - input_mean) / input_std