Layering as Optimization Decomposition: A Mathematical Theory of Network Architectures | Synapse