saliency/visualizer/smiles_visualizer.py
def min_max_scaler(saliency):
    """Normalize saliency to value 0-1"""
    maxv = numpy.max(saliency)
    minv = numpy.min(saliency)
    if maxv == minv:
        saliency = numpy.zeros_like(saliency)
    else:
        saliency = (saliency - minv) / (maxv - minv)
    return saliency
Normalize saliency to value 0-1
Normalize saliency to value 0-1
Normalize saliency to value 0 - 1
def min_max_scaler(saliency):
    maxv = numpy.max(saliency)
    minv = numpy.min(saliency)
    if maxv == minv:
        saliency = numpy.zeros_like(saliency)
    else:
        saliency = (saliency - minv) / (maxv - minv)
    return saliency
def min_max_scaler ( saliency ) : maxv = numpy . max ( saliency ) minv = numpy . min ( saliency ) if maxv == minv : saliency = numpy . zeros_like ( saliency ) else : saliency = ( saliency - minv ) / ( maxv - minv ) return saliency
Normalize saliency to value 0-1
Normalize saliency to value 0 - 1
"""Normalize saliency to value 0-1"""
saliency