I want to implement in python some algorithms from a paper that allow for a pre-trained neural network to be modified (adding or removing neurons or layers) conserving (theoretically) the outputs of the network over the training data.
I've researched a bit on pytorch, keras and tensorflow and I'm not sure which one is more efficient for implementing this algorithms. For instance, in pytorch I've created a function that implements the neuron addition algorithm by cloning the pre-trained network to a bigger network and adjusting the weights. This approach seems rather inefficient to me.
I think that implementing this algorithms from scratch in numpy wouldn't be as useful for further research. Do you know of a library in which I could freely add and remove neurons and change weights while being efficient?