Ultrafast photonic reinforcement learning