How PyLate handles dense layers and embedding sizes
mainWhen creating a PyLate model from a base encoder, PyLate automatically adds a dense layer to project the output dimension to a target embedding_size.
- Default behavior: If
embedding_sizeis not specified, it defaults to128. - Sentence-Transformers (ST) models: If you use an ST model, PyLate loads its existing dense layer. It will only add an additional dense layer if you specify an
embedding_sizethat does not match the size of the ST model's last dense layer. - Customization: To bypass the default ST dense layers and use your own architecture, use the modular
modulessyntax.