Learning Graph Cut Energy Functions for Image Segmentation