Networks of neurons in the brain encode preferred patterns of neural activity via their synaptic connections. Despite receiving considerable attention, the precise relationship between network connectivity and encoded patterns is still poorly understood. Here we consider this problem for networks of threshold-linear neurons whose computational function is to learn and store a set of binary patterns (e.g., a neural code) as "permitted sets" of the network. We introduce a simple encoding rule that selectively turns "on" synapses between neurons that coappear in one or more patterns. The rule uses synapses that are binary, in the sense of having only two states ("on" or "off"), but also heterogeneous, with weights drawn from an underlying synaptic strength matrix S. Our main results precisely describe the stored patterns that result from the encoding rule, including unintended "spurious" states, and give an explicit characterization of the dependence on S. In particular, we find that binary patterns are successfully stored in these networks when the excitatory connections between neurons are geometrically balanced--i.e., they satisfy a set of geometric constraints. Furthermore, we find that certain types of neural codes are natural in the context of these networks, meaning that the full code can be accurately learned from a highly undersampled set of patterns. Interestingly, many commonly observed neural codes in cortical and hippocampal areas are natural in this sense. As an application, we construct networks that encode hippocampal place field codes nearly exactly, following presentation of only a small fraction of patterns. To obtain our results, we prove new theorems using classical ideas from convex and distance geometry, such as Cayley-Menger determinants, revealing a novel connection between these areas of mathematics and coding properties of neural networks.

network neuron brain encod prefer pattern neural activ via synapt connect despit receiv consider attent precis relationship network connect encod pattern still poor understood consid problem network thresholdlinear neuron whose comput function learn store set binari pattern eg neural code permit set network introduc simpl encod rule select turn synaps neuron coappear one pattern rule use synaps binari sens two state also heterogen weight drawn under synapt strength matrix s main result precis describ store pattern result encod rule includ unintend spurious state give explicit character depend s particular find binari pattern success store network excitatori connect neuron geometr balancedi satisfi set geometr constraint furthermor find certain type neural code natur context network mean full code can accur learn high undersampl set pattern interest mani common observ neural code cortic hippocamp area natur sens applic construct network encod hippocamp place field code near exact follow present small fraction pattern obtain result prove new theorem use classic idea convex distanc geometri cayleymeng determin reveal novel connect area mathemat code properti neural network