I want to analyse the impact of each layer of CNN. I have trained the CNN model with a dataset. After that, weights of first convolutional layer are fixed and remaining layers are initialise to zero to get the exact impact of first layer. Then test the model with same data. is it correct way?

  • $\begingroup$ What does "impact of a layer" mean? Why would you ever test a model on the same data it was trained? Seems like a recipe for over-fitting. Also, random initialization is almost always prefereable to zero initialization, otherwise the network receives useless gradients. since the weight space becomes constrained. Training layer-by-layer is an outdated strategy used for when backpropagation was too expensive since it tunes layers greedily which often leads to suboptimal results. $\endgroup$ – Anon Feb 5 at 2:40
  • $\begingroup$ I am not retraining the model again to get any overfitting or grdient issue. Its just testing again with same data using few number of layers in the network rather than whole network $\endgroup$ – Aadnan Farooq A Feb 5 at 3:28

I don't think this makes much sense. You can't set other layers of the CNN to 0 and expect any meaningful output. As an analogy, suppose you try to analyze what each organ of a human body does by shutting down the rest and testing how the human performs -- likely nothing good will happen and you won't gain any insight. All parts of the system need to function for the whole thing to function.

Now there may be special cases where this is more reasonable -- you might be able to disable some later residual blocks of a resnet without too much trouble. But in general it's not a good idea.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.