(self, activations, unit=None, mode='bilinear')
return PIL.Image.fromarray(
                (cm.hot((a - amin) / (1e-10 + amax - amin)) * 255
                    ).astype('uint8'))
Produces a heatmap from the given activations.  The unit,
        if specified, is an index into the activations tensor,
        and is also used to dereference quantile ranges.
Produces a heatmap from the given activations.  The unit,
        if specified, is an index into the activations tensor,
        and is also used to dereference quantile ranges.
Produces a heatmap from the given activations . The unit if specified is an index into the activations tensor and is also used to dereference quantile ranges .
def heatmap(self, activations, unit=None, mode='bilinear'):
        '''
        Produces a heatmap from the given activations.  The unit,
        if specified, is an index into the activations tensor,
        and is also used to dereference quantile ranges.
        '''
        amin, amax = self.range_for(activations, unit)
        if unit is None:
            a = activations
        else:
            a = activations[unit]
        upsampler = self.upsampler_for(a)
        a = upsampler(a[None,None,...], mode=mode)[0,0].cpu()
        return PIL.Image.fromarray(
                (cm.hot((a - amin) / (1e-10 + amax - amin)) * 255
                    ).astype('uint8'))
def heatmap ( self , activations , unit = None , mode = 'bilinear' ) : amin , amax = self . range_for ( activations , unit ) if unit is None : a = activations else : a = activations [ unit ] upsampler = self . upsampler_for ( a ) a = upsampler ( a [ None , None , ... ] , mode = mode ) [ 0 , 0 ] . cpu ( ) return PIL . Image . fromarray ( ( cm . hot ( ( a - amin ) / ( 1e-10 + amax - amin ) ) * 255 ) . astype ( 'uint8' ) )