Safe Mutations for Deep and Recurrent Neural Networks through Output Gradients