Learning how to be more resilient