Situating neural function within a biologically plausible optimization framework