I am trying to code a variant of Proximal Policy Optimization algorithm (Reinforcement Learning) in Mathematica, and for the training of the network I need to change the coefficient, beta, of one of the loss terms dynamically after each batch… sometimes the value of beta should be doubled and sometimes halved.
Is there ANY way to do that in Mathematica?
The only way(?) that comes to my mind is that when the TrainingProgressFunction is called after each batch, I get my hands on the #TrainingNet or the network that is being trained, and then change the value of NetArray associated with beta manually to whatever I want for the next round.
However, unfortunately, commands like NetExtract, NetTake, NetReplacePart all create new copies of the net, and hence, won’t be any good. Somehow I need to change or update the very net that is being trained without copying it. To make the beta value not trainable, the LearningRateMultipliers of the NetArrayLayer must be set to None.
Any information or guidance is very much appreciated.