def __init__(self, jitter=0.05):
        """Implements an input modifier that introduces random jitter in `pre`.
        Jitter has been shown to produce crisper activation maximization images.

        Args:
            jitter: The amount of jitter to apply, scalar or sequence.
                If a scalar, same jitter is applied to all image dims. If sequence, `jitter` should contain a value
                per image dim.

                A value between `[0., 1.]` is interpreted as a percentage of the image dimension. (Default value: 0.05)
        """
        super(Jitter, self).__init__()
        self.jitter = np.array(utils.listify(jitter))
        if np.any(jitter < 0.):
            raise ValueError('Jitter value should be positive')
        self._processed = False
def __init__ ( self , jitter = 0.05 ) : super ( Jitter , self ) . __init__ ( ) self . jitter = np . array ( utils . listify ( jitter ) ) if np . any ( jitter < 0. ) : raise ValueError ( 'Jitter value should be positive' ) self . _processed = False
Implements an input modifier that introduces random jitter in `pre`.
        Jitter has been shown to produce crisper activation maximization images.

        Args:
            jitter: The amount of jitter to apply, scalar or sequence.
                If a scalar, same jitter is applied to all image dims. If sequence, `jitter` should contain a value
                per image dim.

                A value between `[0., 1.]` is interpreted as a percentage of the image dimension. (Default value: 0.05)