Learning to represent and reason under limited supervision