The entire network can be trained end-to-end to learn parameters α and β in addition to the sentence embedding and classifier, or the network can be optimized to learn only the weights α and β and weights of the classifier.
work such as ELMo (Peters et al., 2018) and BERT (Devlin et al., 2018) propose deeply connected layers to learn sentence embeddings by exploiting bi-directional contexts.