Reinforcement learning with selective perception and hidden state