Closed-Loop Learning of Visual Control Policies