How to get the policy function?
4 views (last 30 days)
I did simulation with pendulum in Reinforcement learning.
After that, I would like to find a policy function of the post -learning controller.
In this case, the policy function will be a torque (control function) that outputs the controller to the state (angle and angle speed).
In addition, I want to tailor the state (angle and angular speed) like Qtable.
In this case, which one use GeneratePolicyFunction or Getaction?
Is this method correct? Or is there another way? Also, how can I save the network by using Sac (Soft-Acto-Critic)?
%% load 'agent.mat'
%% tiring states(angler velocity , angle)
N = 5; %5 divisions
NN = N*N;
Angle = linspace(-3.14,-4.71,N);
Velocity = linspace(0,-20,N);
State = comvec(Angle,Velocity); % Combination of state, number of tiles 5×5
F = zeros(NN,1); % Policy function (Torque predicted by trainned agent?)
F(:,i) = evaluatePolicy(State(:,1));