An optimal control approach for neural network architecture adaptation with a posteriori error estimation | Digital Library | PAMCET | PAMCET