Checks the image size and its compatibility with classifier's receptive field.

        At this moment it is required that image size = K * receptive_field. This will
        be relaxed in future with the introduction of padding.

def _check_image(self, X):
        """
        Checks the image size and its compatibility with classifier's receptive field.

        At this moment it is required that image size = K * receptive_field. This will
        be relaxed in future with the introduction of padding.
        """

        if (len(X.shape) < 3) or (len(X.shape) > 4):
            raise ValueError('Input has to have shape [n_samples, n_pixels_y, n_pixels_x] '
                             'or [n_samples, n_pixels_y, n_pixels_x, n_bands].')

        self._samples = X.shape[0]
        self._image_size = X.shape[1:3]

        if (self._image_size[0] % self.receptive_field[0]) or (self._image_size[0] % self.receptive_field[0]):
            raise ValueError('Image (%d,%d) and receptive fields (%d,%d) mismatch.\n'
                             'Resize your image to be divisible with receptive field.'
                             % (self._image_size[0], self._image_size[0], self.receptive_field[0],
                                self.receptive_field[1]))