Learning to be a Flexible Sleeper