Skip to main content
. 2023 Oct 24;23(21):8679. doi: 10.3390/s23218679
Algorithm 1: Proximal policy optimization (PPO) for a multivariable system
Initialization: actor function parameters θ, critic function parameters ϕ, hyperparameters: truncation factor ε, number of sub-iterationsM,B
for k = 0, 1, 2, … do
 Randomly initialize setpoints SP within the range allowed for each loop of a multivariable coupling system.
 Enforce policy πθk in the environment, and save the track Dk={τi}
 Calculated rewards Rt
 Calculate the advantage function At based on the current critic function Vϕk
 Normalizing the At using the mean and standard deviation of the current small batch experience
 for m{1,,M} do
  Computing importance sampling weights:
   lt(θ)=πθ(At|St)πθold(At|St)
  Using the Adam stochastic gradient ascent algorithm to maximize the objective function of PPO clip to update the policy:
   θk+1=arg maxθ1|Dk|TτDkt=0Tmin(lt(θ)Aπθold(St,At),clip(lt(θ),1-ε,1+ε)Aπθold(St,At))
 end for
 for b{1,,B} do
  The critic function is learned by minimizing the mean square error using the gradient descent algorithm:
   ϕk+1=arg minϕ1|Dk|TτDkt=0T(Vϕ(St)Rt)2
 end for
end for