def softmax_normalisation(arr):
    """
    softmax normalisation, ie., let sum of each 2D slice in an array = 1
    """
    
    if arr.ndim == 3:
        
        for itr in range(arr.shape[-1]):
            
            arr[:,:,itr] /= arr[:,:,itr].sum()
    
    return arr