Extracting Embeddings From All Encoder Layers of BERT
Learn how to extract embeddings from all encoder layers using the transformers library.
We've extract the embeddings obtained from the final encoder layer of the pre-trained model. Now the question is, should we consider the embeddings obtained only from the final encoder layer (final hidden state), or should we also consider the embeddings obtained from all the encoder layers (all hidden states)? Let's explore this.
Let's represent the input embedding layer with
Get hands-on with 1400+ tech skills courses.