Optimization Principles for the Neural Code