Learning to Adapt to Light