Learning to Explore and Exploit in POMDPs