A Self-Learning Strategy for Task Offloading in UAV Networks