def split_img(img):
    """
    Split mnist image

    Split an mnist example input (28x28 np.array of floats) into two
    called x and y, where x is the upper first 392=784/2 pixels and y
    the latter 392 pixels.

    :param img: binary numpy array of an mnist image
    :return: two half images for x and y
    """
    dim = img.shape[1]
    x = img[:, :dim]
    y = img[:, :-dim]
    return x, y