How to compute the gradients of SAC agent for custom training. In additon, is the target critics are updated automatically by matlab, given that agent =rlSACAgent()
6 次查看(过去 30 天)
显示 更早的评论
I'm trying to train multi SAC agent using parallel computing, i don't know how to compute the gradients of agents using dlfeval function, knowing that i have created minibatchqueue for data processing. In addition, given that the agents have been created as agent=rlSACAgent(actor1,[critic1,critic2],agentOpts) , should i introduce the critics targets or they are internally handled by MATLAB by specifying the smoothing factor tau or updating frequency of target critic, and how i can update them?
0 个评论
回答(1 个)
praguna manvi
2024-9-4
编辑:praguna manvi
2024-9-4
The critic and actor networks are updated internally using the “train” function for agents defined as:
agent = rlSACAgent(actor,[critic1,critic2],agentOpts);
You can find an example of training a rlSACAgent in this documentation:
For custom training you can refer to this documentation, which outlines the functions needed:
Typically, you could use “getValue” or “getAction” functions to extract outputs, calculate loss and compute gradients with “dlgradient”. Here is a link to another example with custom training using sampled minibatch experiences:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Custom Training Loops 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!