Great questions! Let's tackle each of your queries step-by-step:
1. Scaling Layer for Actor Network
Yes, you should use the scaling layer at the end of the actor network to scale the actions to the desired range. The values you provided look correct:
scalingLayer('Name','ActorScaling1','Scale',[5;pi],'Bias',[5;pi])
This will scale the first action to the range [0, 10] and the second action to the range [0, 2π).
2. Exploration Noise and Target Policy Noise
For TD3, it's important to add noise to the actions to encourage exploration. Given your action space ranges are not within [-1, 1], you'll need to adjust the noise accordingly:
-
Exploration Noise: This noise is added to the actions during training to explore the action space. A common approach is to use a Gaussian noise with a small standard deviation relative to the action range. For your case, you might start with something like:explorationNoiseVariance = [1 0.1]; % Variances for the two actions
explorationNoise = sqrt(explorationNoiseVariance) .* randn(size(action)); - Target Policy Noise: This noise is added to the actions taken by the target policy network. It's typically smaller than the exploration noise to provide smooth updates. You might start with:
- targetPolicyNoiseVariance = [0.5 0.05]; % Variances for the two actions
targetPolicyNoise = sqrt(targetPolicyNoiseVariance) .* randn(size(action)); -
3. Clipping Action Values
While
rlTD3AgentOptionsdoesn't have a built-in action clipping feature, you can manually clip the actions using theminandmaxfunctions after scaling.
Explore similar technical troubleshooting questions and verified MATLAB solutions: