Adaptation of Artificial Neural Networks Avoiding Catastrophic Forgetting