To train the model, one first needs to calculate the predicted sentiment distribution for each node: and then compute the posterior probability over the m labels: During learning, following the method used by the RNTN model in (Socher et al., 2013), PSTN also aims to minimize the cross-entropy error between the predicted distribution y i ∈ R m×1 at node i and the target distribution t i ∈ R m×1 at that node.
the error for a sentence is calculated as: where, λ represents the regularization hyperparameters, and j ∈ m denotes the j-th element of the multinomial target distribution.