Resilient Control of Cyber-Physical Systems with Distributed Learning