Learning to Set Boundaries