How does learning occur? In the context of neural networks, learning occurs via optimization, where a loss function is minimized to achieve the desired result. But physical networks such as mechanical spring networks or flow networks cannot minimize such a loss function by themselves—they need the help of a computer. An alternative is to encode local rules into those networks so that they can evolve under external driving to develop function. For example, if the springs in a mechanical network have equilibrium lengths that grow if the springs are stretched, and shrink when the springs are compressed, the network will naturally evolve under applied stresses. I will describe how both of these strategies—global minimization of a loss function as well as training by local rules--can be used to teach materials how to perform functions inspired by biology, such as the ability of proteins (e.g. hemoglobin) to change their conformations upon binding of an atom (oxygen) or molecule, or the ability of the brain’s vascular network to send enhanced blood flow and oxygen to specific areas of the brain associated with a given task.