When artificial neural networks learn a task, one solves an inverse design problem. What network will produce the desired output? We have harnessed AI ideas to design physical systems to perform functions inspired by biology, such as allostery in proteins. But artificial neural networks require a computer in order to learn global fashion by minimizing a cost function. By contrast, the brain learns by local rules, with each neuron adjusting without knowing what all the other neurons are doing. We have introduced a physics-based approach to learning by local rules that has been realized in simple electrical circuits that learn on their own, without a processor or external memory.