How does learning occur? Neural networks learn via optimization, where a loss function is minimized by a computer to achieve the desired result. But physical networks such as mechanical spring networks or flow networks have no central processor so they cannot minimize such a loss function. 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 systems 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, 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, or the ability of the brain to perform classification.