The relevant limit for machine learning is not N → infinity but instead N → 0, the human visual system is proof that it is possible to learn categories with extremely few samples; humans do not need N = million images to distinguish edible mushrooms from poisonous ones in the wild. This ability is the result of having seen millions of other objects. The first part of the talk will discuss algorithms to adapt representations of deep neural networks to new categories given few labeled data. The second part will exploit a formal connection of thermodynamics and machine learning to characterize such adaptation and understand the fundamental limits of representation learning. This theory leads to algorithms for transfer learning that come with guarantees on the classification performance on the target task.