def get_num_features(fp_size, kernel_size, padding, stride):
    """Computes the number of features created by a 2d convolution.

    See: http://cs231n.github.io/convolutional-networks/
    """
    return (fp_size - kernel_size + 2 * padding) / stride + 1