Resilient Peer-to-peer Learning based on Adaptive Aggregation