Topological derivative approach for deep neural network architecture adaptation