Skip to main content
. 2024 Feb 22;24(5):1429. doi: 10.3390/s24051429
Algorithm 1. The pseudocode of the model.
Input: Time-frequency characteristics X1,X2,,XT
Output: Emotion categories and probabilities Y, P
// Bi-GRU algorithm (forward and backward)
htGRUxt,ht1
htGRUxt,h˜t1
ht=[ht,ht]
// Multi-head Attention algorithm
Q=htWq, K=htWk, V=htWv
AttentionScorei=softmaxQWQiTKTdk
headi=AttentionScoreiV
MultiHeadQ,K,V=Concathead1,,headhWO
// Linear layer and output layer
Y=full connectMultiHeadQ,K,V
Y=softmax(Y)