Hello Deepti_Prasad,
the encoder_visualization-layer is created here and the weights are initialized randomly (as always):
This layer is “fed” from the output of bottle_neck, in fact it is a fork of the data flow as the output of the bottle_neck layer is also fed into the decoder in parallel (last line):
Thus the encoder_visualization-layer is not part of the backward-propagation path of the auto -encoder.
Now the auto_encoder and the embedding-visualization-model is formed, but only the auto-encoder is trained:
As I understand it, this means that the encoder_visualization layer is not trained, so its weights remain in the random initial state.
This layer is not used in the sense of an ML model, but in my opinion is only a kind of auxiliary function to visualize the embedding, i.e. to convert the 7x7x256 embedding matrix into a 7x7x1 image.
So there is no need for training here, there is nothing to learn.
My point now is: If I create the encoder_visualization-layer a second time, it will have different values in the weights and thus my encoding visualization will look different in both cases, even if the underlying embedding is the same.
So my question is whether it would be better to use fixed weights.
I agree with you when it comes to the ML context: the model should find the best weight values itself and nothing should be specified, but here we actually only have the layer as an auxiliary function - there is nothing to learn.
Surely you can say that all this is not so relevant because it is only about the principle of displaying embeddings, so it doesn’t matter if they are always different and how they look.
I think the approach of displaying the embeddings makes sense and then, in my opinion, it is quite relevant in practice that the results are not random.
I’m asking here because I want to make sure that my conclusions are correct and to avoid overlooking or misunderstanding something.
Thanks for your help with this!