Skip to main content
. 2024 Jun 25;24(13):4117. doi: 10.3390/s24134117
Algorithm 1 Model training process by using multi-task adaptive dynamic adjustment loss function
Preparation:
Input: Training samples D={(xi,yir,yic)}i=1n
Initial learning rate: γ
Training:
     for j = 1, 2, …, N do:
        if j = 1:
        Input x into the model
        Output:  yir , y^ic
        Calculate the loss function Equations (16) and (17)
        break
     else:
        Input x into the model
        Output:  yir , y^ic
        Calculate the αj and βj by Equations (19) and (20)
        Calculate the regression and classification loss by Equations (16) and (17)
        Calculate the total loss by Equation (18)
        Update the model parameters W b by using Adam optimizer
     End for
Return:
The trained model parameters: W b